华为路由器:单臂路由
进入编辑模式
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
改个名字
[Huawei]sys R1
[R1]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
Oct 18 2020 12:28:56-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0.10 has entered the UP state.
[R1-GigabitEthernet0/0/0.10]arp broadcast enable #命令用来使能终结子接口的ARP广播功能
[R1-GigabitEthernet0/0/0.10]q
arp broadcast enable
命令用来使能终结子接口的ARP广播功能。
undo arp broadcast enable
命令用来取消终结子接口的ARP广播功能。
缺省情况下,终结子接口没有使用ARP广播功能。只有配置了mode user-termination
命令和control-vid
命令后,才能在对应的子接口上配置arp broadcast enable
命令。
当IP报文需要从终结子接口发出,但是没有相应的ARP表项时:
- 如果终结子接口上没有配置arp broadcast enable命令,那么系统会直接把该IP报文丢弃。此时该终结子接口的路由可以看作是黑洞路由。
- 如果终结子接口上配置了arp broadcast enable命令,那么系统会构造带Tag的ARP广播报文,然后再从该终结子接口发出。
注意:开启或关闭终结子接口的ARP广播功能,会使该终结子接口的路由状态发生一次先Down再Up的变化,从而可能导致整个网络的路由发生一次震荡,影响正在运行的业务。
用同样的方法配置g0/0/0.20
[R1]int g0/0/0.20
[R1-GigabitEthernet0/0/0.20]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
[R1-GigabitEthernet0/0/0.20]q
[R1]
进入编辑模式改名
Please press enter to start cmd line!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys switch
g0/0/24
配置成trunk
,并且允许所有vlan通过
[switch]int g0/0/24
[switch-GigabitEthernet0/0/24]port link-type trunk
[switch-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[switch-GigabitEthernet0/0/24]q
[switch]vlan 10
[switch-vlan10]q
[switch]vlan 20
[switch-vlan20]q
g0/0/1
和g0/0/2
加入到vlan10
,并且允许所有vlan通过
[switch-GigabitEthernet0/0/1]port link-type trunk
[switch-GigabitEthernet0/0/1]port trunk pvid vlan 10
[switch-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[switch-GigabitEthernet0/0/1]
[switch-GigabitEthernet0/0/2]port link-type trunk
[switch-GigabitEthernet0/0/2]port trunk pvid vlan 10
[switch-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[switch-GigabitEthernet0/0/2]q
g0/0/3
和g0/0/4
加入到vlan20
,并且允许所有vlan通过
[switch-GigabitEthernet0/0/3]port link-type trunk
[switch-GigabitEthernet0/0/3]port trunk pvid vlan 20
[switch-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[switch-GigabitEthernet0/0/4]port link-type trunk
[switch-GigabitEthernet0/0/4]port trunk pvid vlan 20
[switch-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[switch-GigabitEthernet0/0/4]q
[switch]
在PC1上ping
PC3和PC4
Welcome to use PC Simulator!
PC>ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.2: bytes=32 seq=2 ttl=127 time=94 ms
From 192.168.2.2: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.2.2: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.2: bytes=32 seq=5 ttl=127 time=94 ms
--- 192.168.2.2 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/82/94 ms
PC>ping 192.168.2.1
Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.1: bytes=32 seq=2 ttl=127 time=93 ms
From 192.168.2.1: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.2.1: bytes=32 seq=4 ttl=127 time=94 ms
From 192.168.2.1: bytes=32 seq=5 ttl=127 time=46 ms