组网要求:LAN 1和LAN 2网段相同,AR1已配置到达LAN 3的路由。将路由器的GE0/0/0和GE0/0/1加入相同的网桥组,LAN 1和LAN 2可以互通。在路由器上创建网桥组虚接口Bridge-if 1,LAN 1和LAN 2通过网桥组虚接口路由转发报文,实现和LAN 3的通信。
一、华为模拟器实际操作视频:
二、配置注意事项
● 加入网桥组的接口必须是三层接口,三层接口除了以太类型,还有ATM、Serial等其他类型。
● LAN 1和LAN 2中的PC终端在同一网段。
● 创建的网桥组虚接口编号和网桥组编号保持一致。
三、IP设置:
1、PC1:192.168.10.1/24
PC2:192.168.10.2/24
PC3:192.168.20.1/24
AR1:bridge if 1:192.168.10.254/24 ,10.0.0.1/24
AR2:10.0.0.2/24,192.168.20.254/24
四、AR1的主要配置文件:
#
sysname AR1
#
board add 0/4 4GET
#
bridge 1 //创建网桥组,生成虚拟网桥
routing ip //使能网桥组对IP协议报文的路由功能
#
interface GigabitEthernet0/0/0
bridge 1 //接口加入网桥组,作为虚拟网桥的接口
#
interface GigabitEthernet0/0/1
bridge 1
#
interface GigabitEthernet0/0/2
ip address 10.0.0.1 255.255.255.0
#
interface Bridge-if1 //创建网桥组虚接口,绑定虚拟网桥的接口
ip address 192.168.10.254 255.255.255.0 //用于IP路由转发,实际转发接口为虚拟网桥的接口
#
interface NULL0
#
ip route-static 192.168.20.0 255.255.255.0 10.0.0.2
#
Return
五、AR2的主要配置:
#
sysname AR2
#
interface GigabitEthernet0/0/0
ip address 10.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.20.254 255.255.255.0
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 10.0.0.1
#
return
六、验证配置结果:
1、PC1 ping PC2是通的。
PC>ping 192.168.10.2
Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to break
From 192.168.10.2: bytes=32 seq=1 ttl=128 time
From 192.168.10.2: bytes=32 seq=2 ttl=128 time=16 ms
From 192.168.10.2: bytes=32 seq=3 ttl=128 time=16 ms
From 192.168.10.2: bytes=32 seq=4 ttl=128 time
From 192.168.10.2: bytes=32 seq=5 ttl=128 time
--- 192.168.10.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 0/6/16 ms
2、PC1 ping PC3是通的。
PC>ping 192.168.20.1
Ping 192.168.20.1: 32 data bytes, Press Ctrl_C to break
From 192.168.20.1: bytes=32 seq=1 ttl=126 time=15 ms
From 192.168.20.1: bytes=32 seq=2 ttl=126 time=15 ms
From 192.168.20.1: bytes=32 seq=3 ttl=126 time=31 ms
From 192.168.20.1: bytes=32 seq=4 ttl=126 time=16 ms
From 192.168.20.1: bytes=32 seq=5 ttl=126 time=16 ms
--- 192.168.20.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/18/31 ms
领取专属 10元无门槛券
私享最新 技术干货