目录
🦐博客主页:大虾好吃吗的博客
🦐专栏地址:huawei专栏
单臂路由:单臂路由(router-on-a-stick)是指在路由器的一个接口上通过配置子接口(或“逻辑接口”,并不存在真正物理接口)的方式,实现原来相互隔离的不同VLAN(虚拟局域网)之间的互联互通。
简单来说,可以实现网络中不同VLAN之间通信。
路由器配置封装,启用子接口0/0/0.1和0/0/0.2,网关配置分别配置为1.0.0.1、2.0.0.1,交换机与路由器之间设置为trunk模式,交换机和PC之间配置access模式,PC地址根据拓扑图配置。
sys - [Huawei]undo info-center enable
- [Huawei]vlan batch 10 20
- [Huawei]int e0/0/1
- [Huawei-Ethernet0/0/1]port link-type trunk
- [Huawei-Ethernet0/0/1]port trunk allow-pass vlan 10 20
- [Huawei-Ethernet0/0/1]int e0/0/2
- [Huawei-Ethernet0/0/2]port link-type access
- [Huawei-Ethernet0/0/2]port default vlan 10
- [Huawei-Ethernet0/0/2]int e0/0/3
- [Huawei-Ethernet0/0/3]port link-type access
- [Huawei-Ethernet0/0/3]port default vlan 20
sys - [Huawei]undo info-center enable
- [Huawei]int e0/0/0.1
- [Huawei-Ethernet0/0/0.1]dot1q termination vid 10
- [Huawei-Ethernet0/0/0.1]ip add 1.0.0.1 8
- [Huawei-Ethernet0/0/0.1]arp broadcast enable
- [Huawei-Ethernet0/0/0.1]int e0/0/0.2
- [Huawei-Ethernet0/0/0.2]dot1q termination vid 20
- [Huawei-Ethernet0/0/0.2]ip add 2.0.0.1 8
- [Huawei-Ethernet0/0/0.2]arp broadcast enable
使用2网段主机访问1网段主机,访问成功。
- PC>ping 1.0.0.10
-
- Ping 1.0.0.10: 32 data bytes, Press Ctrl_C to break
- From 1.0.0.10: bytes=32 seq=1 ttl=127 time=328 ms
- From 1.0.0.10: bytes=32 seq=2 ttl=127 time=94 ms
- From 1.0.0.10: bytes=32 seq=3 ttl=127 time=94 ms
- From 1.0.0.10: bytes=32 seq=4 ttl=127 time=93 ms
- From 1.0.0.10: bytes=32 seq=5 ttl=127 time=94 ms
-
- --- 1.0.0.10 ping statistics ---
- 5 packet(s) transmitted
- 5 packet(s) received
- 0.00% packet loss
- round-trip min/avg/max = 93/140/328 ms