单臂路由的配置

单臂路由的配置

华为

AR1:
interface GigabitEthernet0/0/0.1  //在子接口下配置
 dot1q termination vid 10   //封装为dot1q,子接口对应vlan10
 ip address 192.168.10.1 255.255.255.0  //配置VLAN10的网关
 arp broadcast enable  //开启ARP广播 

interface GigabitEthernet0/0/0.2  //在子接口下配置
 dot1q termination vid 20   //封装为dot1q,子接口对应vlan20
 ip address 192.168.20.1 255.255.255.0  //配置VLAN20的网关
 arp broadcast enable  //开启ARP广播

LSW1:   

vlan batch 10 20  //创建vlan10、20
interface GigabitEthernet0/0/1
 port link-type trunk   //接路由器的端口设为trunk
 port trunk allow-pass vlan 2 to 4094    //允许所有VLAN通过  2至4094


interface GigabitEthernet0/0/2
 port link-type access  //接路由器的端口设为access
 port default vlan 10   //将端口划分到VLAN10
interface GigabitEthernet0/0/3
 port link-type access  //接路由器的端口设为access
 port default vlan 20   //将端口划分到VLAN20
 

 cisco

 

R0配置:

Router>en
Router#config t
Router(config)#int fa 0/0  //进入路由器0模块第0端口
Router(config-if)#no shutdown  //开启该端口(此时路由连接交换机的端口 从block转到forward)
Router(config-if)#exit    
Router(config)#int fa 0/0.1  //进入第1个子接口
Router(config-subif)#encapsulation dot1Q 10  //封装协议设置为dot1q 允许通过的vlan 为10
Router(config-subif)#ip address 192.168.1.1 255.255.255.0  //该子接口配置IP地址为192.168.1.1
Router(config-subif)#exit    
Router(config)#int fa 0/0.2    //进入第2个子接口
Router(config-subif)#encapsulation dot1q 20 //封装协议设置为dot1q 允许通过的vlan 为20
Router(config-subif)#ip address 192.168.2.1 255.255.255.0 //该子接口配置IP地址为192.168.2.1
Router(config-subif)#end
Router#show ip route  //检查

 Switch>en
Switch#conf t
Switch(config)#vlan 10 //添加vlan 10
Switch(config-vlan)#exit
Switch(config)#fvlan 20 //添加vlan 20
Switch(config-vlan)exit    
Switch(config)interface fastEthernet 0/2  //进入交换机0模块第2端口
Switch(config-if)switchport access vlan 10  //加入vlan 10
Switch(config-if)exit
Switch(config)inter fa 0/3  //进入交换机0模块第3端口
Switch(config-if)switchport access vlan 20  //加入vlan 20
Switch(config-if)exit    
Switch(config)inter fa 0/1    //进入交换机0模块第1端口
Switch(config-if)switchport mode trunk     //设置端口的工作模式为trunk
Switch(config-if)end

总结:

单臂路由路由器上都需要创建子接口,都需要封装以及配置IP,但是华为与Cisco封装的命令不同,华为还需要多配置一条开启ARP广播

交换机上的配置原理一样,但是命令不相同,trunk模式华为需要放行所有vlan通过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jc__jc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值