| HCNA-40 VRRP的跟踪接口及认证 
 
 配置接入交换机 <Huawei>system-view [Huawei]sysnamesw1 [sw1]vlanbatch 10 20 [sw1]interface Ethernet 0/0/1 [sw1-Ethernet0/0/1]portlink-type access [sw1-Ethernet0/0/1]portdefault vlan 10 [sw1-Ethernet0/0/1]interface Ethernet 0/0/2 [sw1-Ethernet0/0/2]portlink-type access [sw1-Ethernet0/0/2]portdefault vlan 20 [sw1-port-group]portlink-type trunk [sw1-port-group]porttrunk allow-pass vlan all [sw1-port-group]return   配置三层交换机 配置VLAN及VLANIF接口地址 <Huawei>system-view [Huawei]sysnamesw2 [sw2]vlanbatch 10 20 100 [sw2-Vlanif10]ipaddress 192.168.10.254 24 [sw2-Vlanif10]interfacevlanif 20 [sw2-Vlanif20]ipaddress 192.168.20.254 24 [sw2-Vlanif20]interfacevlanif 100 [sw2-Vlanif100]ipaddress 172.16.12.2 24 [sw2-Vlanif100]quit [sw2]interfaceGigabitEthernet 0/0/1 [sw2-GigabitEthernet0/0/1]portlink-type trunk [sw2-GigabitEthernet0/0/1]porttrunk allow-pass vlan all 配置三层转发路由接口 [sw2-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/2 [sw2-GigabitEthernet0/0/2]portlink-type access [sw2-GigabitEthernet0/0/2]portdefault vlan 100 [sw2-GigabitEthernet0/0/2]quit 配置VRRP [sw2]interfacevlanif 10 [sw2-Vlanif10]vrrpvrid 1 virtual-ip 192.168.10.1  //配置VRRP虚拟网关地址 [sw2-Vlanif10]vrrpvrid 1 priority 150  //配置优先级 [sw2-Vlanif10]vrrpvrid 1 track interface GigabitEthernet 0/0/2 reduced 100  //配置接口GE0/0/2接口上行跟踪不能链路时优先级减少100 [sw2-Vlanif10]vrrpvrid 1 authentication-mode md5 admin123  //配置VRRP身份认证  [sw2-Vlanif10]interfacevlanif 20  [sw2-Vlanif20]vrrpvrid 2 virtual-ip 192.168.20.1 [sw2-Vlanif20]vrrpvrid 2 priority 100 [sw2-Vlanif20]vrrpvrid 2 authentication-mode md5 admin123 [sw2-Vlanif20]quit 配置OSPF路由协议 [sw2]ospf1  //创建OSPF 进程1 [sw2-ospf-1]area0  //创建骨干区域 [sw2-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234  //配置OSPF区域身份认证 [sw2-ospf-1-area-0.0.0.0]network192.168.10.0 0.0.0.255  //宣告参考网段 [sw2-ospf-1-area-0.0.0.0]network192.168.20.0 0.0.0.255 [sw2-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 [sw2-ospf-1-area-0.0.0.0]return   <Huawei>system-view [Huawei]sysnamesw3 [sw3]vlanbatch 10 20 200 [sw3]interfacevlanif 10 [sw3-Vlanif10]ipaddress 192.168.10.253 24 [sw3-Vlanif10]interfacevlanif 20 [sw3-Vlanif20]ipaddress 192.168.20.253 24 [sw3-Vlanif20]interfacevlanif 200 [sw3-Vlanif200]ipaddress 172.16.13.3 24 [sw3]interfaceGigabitEthernet 0/0/1 [sw3-GigabitEthernet0/0/1]portlink-type trunk [sw3-GigabitEthernet0/0/1]porttrunk allow-pass vlan all [sw3-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/2 [sw3-GigabitEthernet0/0/2]portlink-type access [sw3-GigabitEthernet0/0/2]portdefault vlan 200 [sw3-GigabitEthernet0/0/2]quit [sw3-Vlanif10]vrrpvrid 1 priority 100 [sw3-Vlanif10]vrrpvrid 1 authentication-mode md5 admin123 [sw3-Vlanif10]interfacevlanif 20 [sw3-Vlanif20]vrrpvrid 2 virtual-ip 192.168.20.1 [sw3-Vlanif20]vrrpvrid 2 priority 150 [sw3-Vlanif20]vrrpvrid 2 track interface GigabitEthernet 0/0/2 reduced 100 [sw3-Vlanif20]vrrpvrid 2 authentication-mode md5 admin123 [sw3-Vlanif20]quit [sw3]displayvrrp brief VRID  State       Interface                Type     Virtual IP      ---------------------------------------------------------------- 1     Backup       Vlanif10                 Normal   192.168.10.1    2     Master       Vlanif20                 Normal   192.168.20.1    ---------------------------------------------------------------- Total:2     Master:1     Backup:1     Non-active:0    [sw3]displayvrrp    Vlanif10 | Virtual Router 1     State : Backup     Virtual IP : 192.168.10.1     Master IP : 192.168.10.254     PriorityRun : 100     PriorityConfig : 100     MasterPriority : 150     Preempt : YES   Delay Time : 0 s     TimerRun : 1 s     TimerConfig : 1 s     Auth type : MD5   Auth key  #8F&I0zuJHj<w)JO!C@=N,#     Virtual MAC : 0000-5e00-0101     Check TTL : YES     Config type : normal-vrrp     Create time : 2020-07-24 23:33:09 UTC-08:00     Last change time : 2020-07-24 23:33:53UTC-08:00     Vlanif20 | Virtual Router 2     State : Master     Virtual IP : 192.168.20.1     Master IP : 192.168.20.253     PriorityRun : 150     PriorityConfig : 150     MasterPriority : 150     Preempt : YES   Delay Time : 0 s     TimerRun : 1 s     TimerConfig : 1 s     Auth type : MD5   Auth key :AAlGP+1#*)JlDGI>zbS=:S8#     Virtual MAC : 0000-5e00-0102     Check TTL : YES     Config type : normal-vrrp     Track IF : GigabitEthernet0/0/2  Priority reduced : 100     IF state : UP     Create time : 2020-07-24 23:35:19 UTC-08:00     Last change time : 2020-07-24 23:35:23UTC-08:00 [sw3]ospf1 [sw3-ospf-1]area0 [sw3-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [sw3-ospf-1-area-0.0.0.0]network192.168.10.0 0.0.0.255 [sw3-ospf-1-area-0.0.0.0]network192.168.20.0 0.0.0.255 [sw3-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [sw3-ospf-1-area-0.0.0.0]return   <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceloopback 0  [r1-LoopBack0]ipaddress 100.100.100.100 32 [r1-LoopBack0]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 172.16.12.1 24  [r1-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.13.1 24  [r1-GigabitEthernet0/0/1]quit [r1]displayip interface brief *down:administratively down ^down:standby (l):loopback (s):spoofing Thenumber of interface that is UP in Physical is 4 Thenumber of interface that is DOWN in Physical is 1 Thenumber of interface that is UP in Protocol is 4 Thenumber of interface that is DOWN in Protocol is 1   Interface                         IP Address/Mask      Physical  Protocol   GigabitEthernet0/0/0              172.16.12.1/24       up         up         GigabitEthernet0/0/1              172.16.13.1/24       up         up         GigabitEthernet0/0/2              unassigned           down       down      LoopBack0                        100.100.100.100/32   up         up(s)      NULL0                             unassigned           up         up(s)      [r1]ospf1  [r1-ospf-1]area0 [r1-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r1-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network100.100.100.100 0.0.0.0 [r1-ospf-1-area-0.0.0.0]return <r1>displayospf peer brief        OSPFProcess 1 with Router ID 100.100.100.100          Peer Statistic Information  ----------------------------------------------------------------------------  Area Id          Interface                        Neighbor id      State     0.0.0.0         GigabitEthernet0/0/0            192.168.20.254   Full          0.0.0.0         GigabitEthernet0/0/1            192.168.10.253   Full          ----------------------------------------------------------------------------   PC>tracert100.100.100.100   tracerouteto 100.100.100.100, 8 hops max (ICMP),press Ctrl+C to stop  1  192.168.10.254   31 ms 47 ms  47 ms  2 100.100.100.100   62 ms  78 ms 79 ms PC1 访问100.100.100.100通过SW2   PC>tracert100.100.100.100   tracerouteto 100.100.100.100, 8 hops max (ICMP),press Ctrl+C to stop  1 192.168.20.253   79 ms  46 ms 47 ms  2 100.100.100.100   63 ms  62 ms 63 ms PC1 访问100.100.100.100通过SW3  切断SW2 GE0/0/2上行链路测试冗余 
 
 PC>ping100.100.100.100 -t   Ping100.100.100.100: 32 data bytes, Press Ctrl_C to break From100.100.100.100: bytes=32 seq=4 ttl=254 time=16 ms From100.100.100.100: bytes=32 seq=5 ttl=254 time=32 ms Request timeout!  //只有一个丢包 From100.100.100.100: bytes=32 seq=7 ttl=254 time=78 ms From100.100.100.100: bytes=32 seq=8 ttl=254 time=47 ms From100.100.100.100: bytes=32 seq=9 ttl=254 time=47 ms   ---100.100.100.100 ping statistics ---   16 packet(s) transmitted   15 packet(s) received   6.25% packet loss   round-trip min/avg/max = 16/55/94 ms   PC>tracert100.100.100.100   tracerouteto 100.100.100.100, 8 hops max (ICMP),press Ctrl+C to stop  1  192.168.10.253   31 ms 47 ms  47 ms  2 100.100.100.100   62 ms  63 ms 62 ms 实现了链路的的冗余备份和网关负载均衡 
 |