当前位置:网站首页>vlan路由配置
vlan路由配置
2022-08-08 06:24:00 【捍胃者】

vlan虚拟局域网,分割广播域
在此拓补图的基础上实现全网可达,过程性在代码中解释,只演示r3:
创建环回,对接口下放ip
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 3.3.3.3 32
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 23.1.1.2 24
创建虚拟子接口
[r3]interface g0/0/1.1
[r3-GigabitEthernet0/0/1.1]ip address 192.168.1.1 24
[r3]interface g0/0/1.2
[r3-GigabitEthernet0/0/1.2]ip address 192.168.2.1 24
开启dhcp配置,动态下放ip
[r3]dhcp enable
[r3]ip pool 1
[r3-ip-pool-1]network 192.168.1.0 mask 255.255.255.0
[r3-ip-pool-1]gateway-list 192.168.1.1
[r3-ip-pool-1]dns-list 8.8.8.8
[r3]ip pool 2
[r3-ip-pool-2]network 192.168.2.0 mask 255.255.255.0
[r3-ip-pool-2]gateway-list 192.168.2.1
[r3-ip-pool-2]dns-list 8.8.8.8
调用虚拟子接口
[r3]interface g0/0/1.1
[r3-GigabitEthernet0/0/1.1]dot1q termination vid 2
[r3-GigabitEthernet0/0/1.1]arp broadcast enable
[r3-GigabitEthernet0/0/1.1]dhcp select global
[r3]interface g0/0/1.2
[r3-GigabitEthernet0/0/1.2]dot1q termination vid 3
[r3-GigabitEthernet0/0/1.2]arp broadcast enable
[r3-GigabitEthernet0/0/1.2]dhcp select global
开启ospf协议
[r3]ospf 100 router-id 3.3.3.3
[r3-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255交换机只演示sw2:
创建vlan
[sw2]vlan batch 2 3
划分vlan并改变接口类型
[sw2]interface e0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 2
[sw2]interface e0/0/3
[sw2-Ethernet0/0/3]port link-type access
[sw2-Ethernet0/0/3]port default vlan 3
创建trunk,改为所有vlan可通过
[sw2]interface e0/0/1
[sw2-Ethernet0/0/1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan all以上便配置完成,来看一下结果:


到此,实验结束~
边栏推荐
猜你喜欢

1.Mysql索引的原理

P02 线程的用途

关于剪枝对象的分类(weights剪枝、神经元剪枝、filters剪枝、layers剪枝、channel剪枝、对channel分组剪枝、Stripe剪枝)

略解深度学习优化策略

Flutter 实现一款简单的音乐播放器

《Filter Pruning using Hierarchical Group Sparse》ICPR2020论文详解

人工神经网络的工作原理,神经网络的基本原理

Industry Research: Analysis of the Status and Prospects of the Pension Insurance Market in 2022

3.SQL底层执行原理

ResNet 原理与代码复现
随机推荐
市场调研报告-食品添加剂行业产量为974万吨
Analysis of the status quo of the chemical industry: the polyolefin market consumption is nearly 200 million tons
线程和进程定义
ER图是什么?
MySQL数据库和数据表的增删改查基础
Google Colab 快速上手
传统图像特征提取方法:边缘与角点
Variational Inference with Normalizing Flows
Chemical Industry Research: Current Situation and Scale Analysis of Organic Silica Gel Market
Refrigerator compressor market status research analysis and development prospect forecast
Industry Research: Analysis of the Status and Prospects of the Pension Insurance Market in 2022
cybox target machine wp
《Filter Pruning using Hierarchical Group Sparse》ICPR2020论文详解
MongoDB3.x创建用户与用户角色
文件常用操作 IO流原理及分类
访问修饰符public、private、protected、default(默认不写) 区别
2.Explain详解与索引优化原则
Paramenter-Efficient Transfer Learning for NLP
Equipment industry research report: laser printer market present situation and development trend in the future
MySQL----存储引擎