[SwitchA] ping -a 20.1.1.1 30.1.1.1
Ping 30.1.1.1: 56 data bytes, press CTRL+C to break
Reply from 30.1.1.1: bytes=56 Sequence=1 ttl=254 time=2 ms
Reply from 30.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 30.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 30.1.1.1: bytes=56 Sequence=4 ttl=254 time=2 ms
Reply from 30.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
--- Ping statistics for 30.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.00% packet loss
round-trip min/avg/max/std-dev = 1/1/2/1 ms
[SwitchD] ping -a 30.1.1.1 20.1.1.1
Ping 20.1.1.1: 56 data bytes, press CTRL+C to break
Reply from 20.1.1.1: bytes=56 Sequence=1 ttl=254 time=2 ms
Reply from 20.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
--- Ping statistics for 20.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.00% packet loss
round-trip min/avg/max/std-dev = 1/1/2/1 ms
6 配置文件
Switch A:
#
vlan 2
\#
vlan 3
\#
vlan 6
\#
nqa entry admin test
type icmp-echo
destination ip 10.2.1.4
frequency 100
next-hop ip 10.1.1.2
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
\#
nqa schedule admin test start-time now lifetime forever
\#
interface Vlan-interface2
ip address 10.1.1.1 255.255.255.0
\#
interface Vlan-interface3
ip address 10.3.1.1 255.255.255.0
\#
interface Vlan-interface6
ip address 20.1.1.1 255.255.255.0
\#
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 2
\#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 3
\#
interface GigabitEthernet1/0/3
port link-mode bridge
port access vlan 6
\#
ip route-static 10.2.1.0 24 10.1.1.2
ip route-static 30.1.1.0 24 10.1.1.2 track 1
ip route-static 10.4.1.0 24 10.3.1.3 preference 80
ip route-static 30.1.1.0 24 10.3.1.3 preference 80
\#
track 1 nqa entry admin test reaction 1
\#
Switch D
#
vlan 4
\#
vlan 5
\#
vlan 7
\#
nqa entry admin test
type icmp-echo
destination ip 10.1.1.1
frequency 100
next-hop ip 10.2.1.2
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
\#
nqa schedule admin test start-time now lifetime forever
\#
interface Vlan-interface4
ip address 10.4.1.4 255.255.255.0
\#
interface Vlan-interface5
ip address 10.2.1.4 255.255.255.0
\#
interface Vlan-interface7
ip address 30.1.1.1 255.255.255.0
\#
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 4
\#
interface GigabitEthernet1/0/2
port link-mode bridge
port access vlan 5
\#
interface GigabitEthernet1/0/3
port link-mode bridge
port access vlan 7
\#
ip route-static 10.1.1.0 24 10.2.1.2
ip route-static 20.1.1.0 24 10.2.1.2 track 1
ip route-static 10.3.1.0 24 10.4.1.3 preference 80
ip route-static 20.1.1.0 24 10.4.1.3 preference 80
\#
track 1 nqa entry admin test reaction 1
\#
注意事项
1.nqa启动报错
Incomplete NQA operation parameters. Can't start the NQA operation.
检查配置
[DeviceA-nqa-admin-test1] type icmp-echo
[DeviceA-nqa-admin-test1-icmp-echo] destination ip 10.2.2.2 是否写成了description