Track与nqa联动 VS 静态路由优先级相同
有蛮长一段时间没有写博客了,下面就来说一下Track与nqa联动 VS 静态路由优先级相同的情况,也不知道对不对,请指正!请看下图:
说明:SWA是机房1的,SWB是机房2的,SWC是某银行的,A到B是truck直连,其他是access,C到A时电信专线,C到B是联通专线;A-B-C-PC2和A-C-PC2是互为备份线路。另:图示是GigabitEthernet口,实际配置用Ethernet
SWA配置:
[SWA]interface Ethernet 0/4/0
[SWA-Ethernet0/4/0]port link-type trunk
[SWA-Ethernet0/4/0]port trunk permit vlan all
[SWA]vlan 2
[SWA]interface Vlan-interface 2
[SWA-Vlan-interface2]ip address 10.1.1.1 24
[SWA-Ethernet0/4/1]port link-type access
[SWA-vlan4]port e0/4/1
[SWA-Vlan-interface4]ip address 30.1.1.1 24
[SWA-Ethernet0/4/2]port link-type access
[SWA-vlan5]port e0/4/2
[SWA-Vlan-interface5]ip address 50.1.1.1 24
SWB与SWC同上相似的配置。
PC1 : 50.1.1.2 255.255.255.0 50.1.1.1
PC2 : 60.1.1.2 255.255.255.0 60.1.1.1
首先,我们来看静态路由优先级相同的情况
PC1-SWA-SWC-PC2线路
SWA上配置,目的地址:60.1.1.2/24,下一跳:30.1.1.2/24 ,优先级preference默认60
[SWA]ip route-static 60.1.1.2 24 30.1.1.2
SWC上配置,目的地址:50.1.1.2/24,下一跳:30.1.1.1/24 ,优先级preference默认60
[SWC]ip route-static 50.1.1.2 24 30.1.1.1
[SWC]ping 50.1.1.2
PING 50.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 50.1.1.2: bytes=56 Sequence=1 ttl=63 time=44 ms
Reply from 50.1.1.2: bytes=56 Sequence=2 ttl=63 time=24 ms
Reply from 50.1.1.2: bytes=56 Sequence=3 ttl=63 time=25 ms
[SWA]display ip routing-table
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 Direct 0 0 10.1.1.1 Vlan2
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
30.1.1.0/24 Direct 0 0 30.1.1.1 Vlan4
30.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Direct 0 0 50.1.1.1 Vlan5
50.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
60.1.1.0/24 Static 60 0 30.1.1.2 Vlan4
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[SWC]display ip routing-table
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
20.1.1.0/24 Direct 0 0 20.1.1.2 Vlan3
20.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
30.1.1.0/24 Direct 0 0 30.1.1.2 Vlan4
30.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Static 60 0 30.1.1.1 Vlan4
60.1.1.0/24 Direct 0 0 60.1.1.1 Vlan6
60.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
PC1-SWA-SWB-SWC-PC2线路
SWA上配置,目的地址:60.1.1.2/24,下一跳:10.1.1.2/24 ,优先级preference还是默认60
[SWA]ip route-static 60.1.1.2 24 10.1.1.2
[SWA]dis ip routing-table
Routing Tables: Public
Destinations : 9 Routes : 10
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 Direct 0 0 10.1.1.1 Vlan2
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
30.1.1.0/24 Direct 0 0 30.1.1.1 Vlan4
30.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Direct 0 0 50.1.1.1 Vlan5
50.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
60.1.1.0/24 Static 60 0 30.1.1.2 Vlan4
Static 60 0 10.1.1.2 Vlan2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
SWC上配置,目的地址:50.1.1.2/24,下一跳:20.1.1.1/24 ,优先级preference也还是默认60
[SWC]ip route-static 50.1.1.2 24 20.1.1.1
[SWC]dis ip routing-table
Routing Tables: Public
Destinations : 9 Routes : 10
Destination/Mask Proto Pre Cost NextHop Interface
20.1.1.0/24 Direct 0 0 20.1.1.2 Vlan3
20.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
30.1.1.0/24 Direct 0 0 30.1.1.2 Vlan4
30.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Static 60 0 30.1.1.1 Vlan4
Static 60 0 20.1.1.1 Vlan3
60.1.1.0/24 Direct 0 0 60.1.1.1 Vlan6
60.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
在两条线路都有静态路由的情况下,由于SWB还没有静态路由,所以会出现丢包,还有防止环路
SWB上配置静态路由:
SWB-PC1线路
[SWB]ip route-static 50.1.1.2 24 10.1.1.1
SWB-PC2线路
[SWB]ip route-static 60.1.1.2 24 20.1.1.2
[SWB]dis ip routing-table
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 Direct 0 0 10.1.1.2 Vlan2
10.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
20.1.1.0/24 Direct 0 0 20.1.1.1 Vlan3
20.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Static 60 0 10.1.1.1 Vlan2
60.1.1.0/24 Static 60 0 20.1.1.2 Vlan3
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
当两条线路优先级都是一样的时候,关闭SWA或者SWC其中的一个接口,另一条线路是通的,因为是交互的
[SWA-Vlan-interface4]shutdown
50.1.1.2 icmp_seq=497 ttl=61 time=40.000 ms
50.1.1.2 icmp_seq=498 ttl=61 time=30.000 ms
50.1.1.2 icmp_seq=499 ttl=61 time=50.000 ms
50.1.1.2 icmp_seq=500 ttl=61 time=30.000 ms
50.1.1.2 icmp_seq=501 ttl=61 time=40.000 ms
Track与nqa联动的情况,必须两边都配置联动,如果只有一边,那么只能探测到对端的线路是否联通。
PC1-SWA-SWC-PC2线路
SWA上配置,目的地址:60.1.1.2/24,下一跳:30.1.1.2/24 ,优先级默认60,该路由与
Track 项 1关联。
[SWA]ip route-static 60.1.1.2 24 30.1.1.2 track 1
PC1-SWA-SWB-SWC-PC2线路
SWA上配置,目的地址:60.1.1.2/24,下一跳:10.1.1.2/24 ,优先级preference是70
[SWA]ip route-static 60.1.1.2 24 10.1.1.2 preference 70
[SWA]nqa entry admin dianxin
[SWA-nqa-admin-dianxin]type icmp-echo
[SWA-nqa-admin-dianxin-icmp-echo]destination ip 30.1.1.2
[SWA-nqa-admin-dianxin-icmp-echo]frequency 100
[SWA-nqa-admin-dianxin-icmp-echo]reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
[SWA-nqa-admin-dianxin-icmp-echo]quit
[SWA]nqa schedule admin dianxin start-time now lifetime forever
[SWA]track 1 nqa entry admin dianxin reaction 1
[SWA]dis track all
Track ID: 1
Status: Positive
Duration: 0 days 0 hours 0 minutes 15 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
NQA entry: admin dianxin
Reaction: 1
同上,SWC上配置类似SWA,这样可以互相探测对方的线路的联通性。
例如:关闭SWC其中的一个端口,track就可以启动另一条备份线路了
[SWC-Vlan-interface4]shutdown
[SWC-Vlan-interface4]
%Apr 27 22:30:49:220 2014 SWC IFNET/3/LINK_UPDOWN: Vlan-interface4 link status is DOWN.
%Apr 27 22:30:49:220 2014 SWC IFNET/5/LINEPROTO_UPDOWN: Line protocol on the interface Vlan-interface4 is DOWN.
[SWC-Vlan-interface4]
[SWC-Vlan-interface4]display ip routing-table
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost NextHop Interface
20.1.1.0/24 Direct 0 0 20.1.1.2 Vlan3
20.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
50.1.1.0/24 Static 70 0 20.1.1.1 Vlan3
60.1.1.0/24 Direct 0 0 60.1.1.1 Vlan6
60.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
本文出自 “雨路良木子” 博客,谢绝转载!