- 配置各接口所属的VLAN
[LSW1]vlan batch 100 200 300
[LSW1-GigabitEthernet0/0/1]port link-type trunk
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100
[LSW1-GigabitEthernet0/0/1]port trunk pvid vlan 100
[LSW1-GigabitEthernet0/0/2]port link-type trunk
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 200
[LSW1-GigabitEthernet0/0/2]port trunk pvid vlan 200
[LSW1-GigabitEthernet0/0/3]port link-type trunk
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 300 - 配置VLANIF接口的IP地址
[LSW1-Vlanif100]ip add 10.1.1.2 24
[LSW1-Vlanif200]ip add 10.1.2.2 24
[LSW1-Vlanif300]ip add 10.1.3.2 24 - 配置NQA测试例
[LSW1]nqa test-instance user test1
[LSW1-nqa-user-test1]test-type icmp
[LSW1-nqa-user-test1]destination-address ipv4 10.1.1.1
[LSW1-nqa-user-test1]frequency 11
[LSW1-nqa-user-test1]probe-count 2
[LSW1-nqa-user-test1]interval seconds 5
[LSW1-nqa-user-test1]timeout 4
[LSW1-nqa-user-test1]start now
[LSW1]nqa test-instance user test2
[LSW1-nqa-user-test2]test-type icmp
[LSW1-nqa-user-test2]destination-address ipv4 10.1.2.1
[LSW1-nqa-user-test2]frequency 11
[LSW1-nqa-user-test2]probe-count 2
[LSW1-nqa-user-test2]interval seconds 5
[LSW1-nqa-user-test2]timeout 4
[LSW1-nqa-user-test2]start now - 配置静态缺省路由,并绑定NQA测试例
[LSW1]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1 track nqa user test1
[LSW1]ip route-static 0.0.0.0 0.0.0.0 10.1.2.1 track nqa user test2
[AR1]ip route-static 10.1.0.0 16 10.1.1.2
[AR2]ip route-static 10.1.0.0 16 10.1.2.2 - 配置AR的IP地址
[AR1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[AR2-GigabitEthernet0/0/0]ip add 10.1.2.1 24 - 验证配置
Shutdown LSW1的G0/0/2口后