Routing loop due to Static pointing to not directly connected IP
May 31, 2010 at 11:16 pm | Posted in Blogroll | Leave a commentStatic routes that point to an IP that is not locally connected are hidden bombs that can explode any time. This is because this sort of static routes do not show up in the routing table if the next hop is not routable or routed via default route. In order for the static route to be install in the routing table, the next hop need to be routed via a more specific route than the default route.
As a result, these sort of static routes (pointing to nowhere, or I call it “pointing to hell”) may bite you at a later stage, even when you make an unlikely related change.
This example show that the routing loop starts to kick in, once we add a summary route somewhere else.
PE1# interface Serial1/1 description Connection to PE3 ip address 13.0.0.1 255.255.255.0 ip route 123.123.123.0 255.255.255.0 3.3.3.1 name Static_to_Hell router bgp 13 network 123.123.123.0 mask 255.255.255.0 redistribute static neighbor 13.0.0.3 remote-as 13 neighbor 13.0.0.3 next-hop-self PE3# ! interface Serial1/2 description Connection to PE1 ip address 13.0.0.3 255.255.255.0 ! interface Serial1/3 description Connection to iNET2 ip address 23.0.0.3 255.255.255.0 ! interface Loopback333 description Just to similate specific of aggregation route ip address 3.3.3.3 255.255.255.255 router bgp 13 no synchronization bgp log-neighbor-changes network 3.3.3.3 mask 255.255.255.255 aggregate-address 3.3.3.0 255.255.255.0 redistribute connected neighbor 13.0.0.1 remote-as 13 neighbor 13.0.0.1 next-hop-self neighbor 23.0.0.2 remote-as 2 no auto-summary iNET2#sh run int s1/1 Building configuration... Current configuration : 86 bytes ! interface Serial1/1 description Connection to PE3 ip address 23.0.0.2 255.255.255.0 router bgp 2 no synchronization bgp log-neighbor-changes neighbor 23.0.0.3 remote-as 13 neighbor 23.0.0.3 default-originate no auto-summary PE1#sh ip route 123.123.123.0 Routing entry for 123.123.123.0/24 Known via "static", distance 1, metric 0 Redistributing via bgp 13 Advertised by bgp 13 Routing Descriptor Blocks: * 3.3.3.1 Route metric is 0, traffic share count is 1 PE3#sh ip route 123.123.123.0 Routing entry for 123.123.123.0/24 Known via "bgp 13", distance 200, metric 0, type internal Last update from 13.0.0.1 00:01:32 ago Routing Descriptor Blocks: * 13.0.0.1, from 13.0.0.1, 00:01:32 ago Route metric is 0, traffic share count is 1 AS Hops 0 iNET2#traceroute 123.123.123.123 ttl 1 10 Type escape sequence to abort. Tracing the route to 123.123.123.123 1 23.0.0.3 36 msec 12 msec 16 msec 2 13.0.0.1 [AS 13] 20 msec 72 msec 12 msec 3 13.0.0.3 [AS 13] 24 msec 44 msec 68 msec 4 13.0.0.1 [AS 13] 48 msec 44 msec 64 msec 5 13.0.0.3 [AS 13] 16 msec 48 msec 76 msec 6 13.0.0.1 [AS 13] 96 msec 60 msec 52 msec 7 13.0.0.3 [AS 13] 80 msec 140 msec 80 msec 8 13.0.0.1 [AS 13] 76 msec 88 msec 72 msec 9 13.0.0.3 [AS 13] 100 msec 76 msec 116 msec 10 13.0.0.1 [AS 13] 32 msec 120 msec 128 msec PE3#c Enter configuration commands, one per line. End with CNTL/Z. PE3(config)#router bgp 13 PE3(config-router)# no aggregate-address 3.3.3.0 255.255.255.0 PE3(config-router)#end PE1#sh run | in ip route ip route 123.123.123.0 255.255.255.0 3.3.3.1 name Static_to_Hell PE1#sh ip route 123.123.123.0 % Network not in table NO MORE LOOPING iNET2#traceroute 123.123.123.123 ttl 1 10 Type escape sequence to abort. Tracing the route to 123.123.123.123 1 * * * 2 * * *
TCL script
May 28, 2010 at 12:38 am | Posted in Blogroll, TCL | 2 CommentsHere’s my fav:
puts [open "flash:ping-script" w+] { puts "" show clock puts " -- Start pinging ..." puts "" foreach i { 61.88.88.88 2.2.2.2 123.123.123.123 33.33.33.33 google.com www.news.com.au } { if {[regexp "!" [exec "ping $i rep 3 time 1"]]} {puts "$i OK"} else {puts "$i ***unreachable***"}} show clock puts " -- Pings stopped." puts "" } (tcl)# quit
Then to execute the file from enabled mode:
#tclsh ping-script
Reference:
http://blog.ru.co.za/2009/03/28/tcl-script-variations/#more-684
First method is kinda cool, since you creating an executable file in flash that is there, to be used whenever.
(the w+ means to write/overwrite, or if you want to append the file use a+ instead)
#tclsh
puts [open "flash:ping-script.tcl" w+] {
foreach IP {
150.1.1.1
204.12.1.254
} { puts [ exec "ping $IP re 2" ] }
}
(tcl)#tclquit
Then to execute the file from global configuration mode:
#tclsh ping-script.tcl
Second method is pretty pointless unless you writing a beeg script and actually using ‘process’ for what it is meant. Problem here is once you exit tcl-shell, the info is gone.
To execute while in tclsh just type the name
#tclsh
proc ping-script {} {
foreach IP {
150.1.1.1
204.12.1.254
} { puts [ exec "ping $IP re 2" ] }
}
(tcl)#ping-script
Third method is the most common one I have seen guys use. And its not bad, but still to much syntax to remember off-hand.
This will execute the ping command once <RETURN> is pressed at the last line.
#tclsh
foreach IP {
150.1.1.1
204.12.1.254
} { puts [ exec "ping $IP re 2" ] }
Best method, is a almost always the shortest one. Again execution will auto follow once the script is complete.
(oh and ‘IP’ is just a arbitrary name I used, not a tcl value)
#tclsh
foreach IP {
150.1.1.1
204.12.1.254
} {ping $IP re 2}
TE Affinity Bits
May 18, 2010 at 10:31 pm | Posted in Blogroll | Leave a commentBy default, Affinity of a TE tunnel is 0x0/0xFFFF. This means, this tunnel can only be placed accross links with affinity attributes 0x0.
If we want a tunnel that can cross any link, we need to set its affinity to 0x0 mask 0x0.
R1#sh mpls traffic-eng tunnels tu0
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: down Path: not valid Signalling: Down
path option 5, type explicit R1_R2
path option 10, type dynamic
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
R1(config-if)#int tun0
R1(config-if)#tunnel mpls traffic-eng affinity 0x0 mask 0x0
R1(config-if)#end
R1#sh
*May 18 21:25:17.035: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up
R1#sh mpls t
*May 18 21:25:17.179: %SYS-5-CONFIG_I: Configured from console by console
R1#sh mpls tra
R1#sh mpls traffic-eng tun
R1#sh mpls traffic-eng tunnels
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 2)
path option 5, type explicit R1_R2
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0x0
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/1, 24
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 0, Tun_Instance 408
RSVP Path Info:
My Address: 14.0.0.1
Explicit Route: 14.0.0.4 24.0.0.4 24.0.0.2 2.2.2.2
Record Route: NONE
TE tunnel placement via explicit & dynamic paths
May 18, 2010 at 1:35 am | Posted in Blogroll, MPLS, Traffic Engineering | Leave a commentR1#sh run
Building configuration…
Current configuration : 2645 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
ip source-route
ip cef
!
!
!
!
!
!
multilink bundle-name authenticated
mpls traffic-eng tunnels
mpls traffic-eng reoptimize timers frequency 10
mpls traffic-eng reoptimize timers delay installation 5
mpls traffic-eng auto-bw timers frequency 5
!
!
!
!
!
!
!
!
!
!
interface Tunnel0
ip unnumbered Loopback0
tunnel destination 2.2.2.2
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng autoroute announce
tunnel mpls traffic-eng priority 6 6
tunnel mpls traffic-eng bandwidth 55000
tunnel mpls traffic-eng path-option 5 explicit name R1_R2
tunnel mpls traffic-eng path-option 10 dynamic
!
interface Tunnel1
ip unnumbered Loopback0
tunnel destination 2.2.2.2
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng autoroute announce
tunnel mpls traffic-eng priority 5 5
tunnel mpls traffic-eng bandwidth 50000
tunnel mpls traffic-eng path-option 10 dynamic
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 12.0.0.1 255.255.255.0
speed auto
duplex auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 90000 90000
!
interface FastEthernet0/1
ip address 14.0.0.1 255.255.255.0
speed auto
duplex auto
mpls traffic-eng tunnels
mpls ip
ip rsvp bandwidth 90000 90000
!
router ospf 1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 12.0.0.1 0.0.0.0 area 0
network 14.0.0.1 0.0.0.0 area 0
mpls traffic-eng router-id Loopback0
mpls traffic-eng area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
!
ip explicit-path name R1_R4_R3_R2 enable
next-address 14.0.0.4
next-address 34.0.0.3
next-address 23.0.0.2
!
ip explicit-path name R1_R2 enable
next-address 12.0.0.2
!
R1(config)#mpls traffic-eng auto-bw timers frequency ?
<1-604800> seconds between auto-bw
R1(config)#mpls traffic-eng reoptimize events link-up
R1(config)#mpls traffic-eng reoptimize timers delay installation ?
<0-3600> seconds to delay replacement of tunnel LSP
R1(config)#mpls traffic-eng reoptimize timers delay installation 5
R1(config)#mpls traffic-eng reoptimize timers frequency ?
<0-604800> seconds between reoptimizations (0 disables reoptimization)
R1(config)#mpls traffic-eng reoptimize timers frequency 10
R1#
interface Tunnel0
ip unnumbered Loopback0
tunnel destination 2.2.2.2
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng autoroute announce
tunnel mpls traffic-eng priority 6 6
tunnel mpls traffic-eng bandwidth 50000
tunnel mpls traffic-eng path-option 5 explicit name R1_R2 lockdown
tunnel mpls traffic-eng path-option 10 dynamic
!
interface Tunnel1
ip unnumbered Loopback0
tunnel destination 2.2.2.2
tunnel mode mpls traffic-eng
tunnel mpls traffic-eng autoroute announce
tunnel mpls traffic-eng priority 5 5
tunnel mpls traffic-eng bandwidth 50000
tunnel mpls traffic-eng path-option 10 dynamic
ip explicit-path name R1_R4_R3_R2 enable
next-address 14.0.0.4
next-address 34.0.0.3
next-address 23.0.0.2
ip explicit-path name R1_R2 enable
next-address 12.0.0.2
R1#sh mpls traffic-eng tunnels summary
Signalling Summary:
LSP Tunnels Process: running
Passive LSP Listener: running
RSVP Process: running
Forwarding: enabled
Head: 2 interfaces, 2 active signalling attempts, 2 established
34 activations, 32 deactivations
0 SSO recovery attempts, 0 SSO recovered
Midpoints: 0, Tails: 0
Periodic reoptimization: every 10 seconds, next in 1 seconds
Periodic FRR Promotion: Not Running
Periodic auto-bw collection: every 5 seconds, next in 2 seconds
R1#sh mpls traffic-eng tunnels tun0
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 3)
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/1, 22
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 0, Tun_Instance 281
RSVP Path Info:
My Address: 14.0.0.1
Explicit Route: 14.0.0.4 34.0.0.4 34.0.0.3 23.0.0.3
23.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
Shortest Unconstrained Path Info:
Path Weight: 1 (TE)
Explicit Route: 12.0.0.1 12.0.0.2 2.2.2.2
History:
Tunnel:
Time since created: 2 hours, 16 minutes
Time since path change: 6 minutes, 50 seconds
Number of LSP IDs (Tun_Instances) used: 281
Current LSP:
Uptime: 6 minutes, 50 seconds
Prior LSP:
ID: path option 10 [280]
Removal Trigger: path error
R1#sh mpls traffic-eng tunnels tun1
Name: R1_t1 (Tunnel1) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 1)
Config Parameters:
Bandwidth: 50000 kbps (Global) Priority: 5 5 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 50000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/0, implicit-null
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 1, Tun_Instance 132
RSVP Path Info:
My Address: 12.0.0.1
Explicit Route: 12.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=50000 kbits, burst=1000 bytes, peak rate=50000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=50000 kbits, burst=1000 bytes, peak rate=50000 kbits
Shortest Unconstrained Path Info:
Path Weight: 1 (TE)
Explicit Route: 12.0.0.1 12.0.0.2 2.2.2.2
History:
Tunnel:
Time since created: 54 minutes, 44 seconds
Time since path change: 25 minutes, 57 seconds
Number of LSP IDs (Tun_Instances) used: 132
Current LSP:
Uptime: 6 minutes, 54 seconds
Selection: reoptimization
Prior LSP:
ID: path option 10 [39]
Removal Trigger: configuration changed
R1#c
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int tun1
R1(config-if)#shut
R1(config-if)#end
R1#
R1#
R1#
R1#sh mpls traffic-eng tunnels tun0
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 3)
path option 5 reoptimization in progress
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/1, 22
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 0, Tun_Instance 382
RSVP Path Info:
My Address: 14.0.0.1
Explicit Route: 14.0.0.4 34.0.0.4 34.0.0.3 23.0.0.3
23.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
Shortest Unconstrained Path Info:
Path Weight: 1 (TE)
Explicit Route: 12.0.0.1 12.0.0.2 2.2.2.2
History:
Tunnel:
Time since created: 2 hours, 27 minutes
Time since path change: 3 seconds
Number of LSP IDs (Tun_Instances) used: 403
Current LSP:
Uptime: 8 seconds
Selection: reoptimization
Prior LSP:
ID: path option 10 [382]
Removal Trigger: reoptimization completed
R1#sh mpls traffic-eng tunnels summ
Signalling Summary:
LSP Tunnels Process: running
Passive LSP Listener: running
RSVP Process: running
Forwarding: enabled
Head: 2 interfaces, 1 active signalling attempts, 1 established
43 activations, 42 deactivations
0 SSO recovery attempts, 0 SSO recovered
Midpoints: 0, Tails: 0
Periodic reoptimization: every 10 seconds, next in 4 seconds
Periodic FRR Promotion: Not Running
Periodic auto-bw collection: every 5 seconds, next in 2 seconds
R1#sh mpls traff tun tun0
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 5, type explicit R1_R2 (Basis for Setup, path weight 1)
path option 10, type dynamic
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: explicit path option 5 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/0, implicit-null
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 0, Tun_Instance 403
RSVP Path Info:
My Address: 12.0.0.1
Explicit Route: 12.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
Shortest Unconstrained Path Info:
Path Weight: 1 (TE)
Explicit Route: 12.0.0.1 12.0.0.2 2.2.2.2
History:
Tunnel:
Time since created: 2 hours, 28 minutes
Time since path change: 57 seconds
Number of LSP IDs (Tun_Instances) used: 403
Current LSP:
Uptime: 1 minutes, 2 seconds
Selection: reoptimization
Prior LSP:
ID: path option 10 [382]
Removal Trigger: reoptimization completed
R1#
R1#c
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#do sb
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 12.0.0.1 YES manual up up
FastEthernet0/1 14.0.0.1 YES manual up up
Loopback0 1.1.1.1 YES manual up up
Tunnel0 1.1.1.1 YES TFTP up up
Tunnel1 1.1.1.1 YES TFTP administratively down down
R1(config)#int tun1
R1(config-if)#no shut
R1(config-if)#end
R1#
R1#
*May 18 00:32:03.811: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel1, changed state to up
R1#
R1#
R1#
*May 18 00:32:05.003: %SYS-5-CONFIG_I: Configured from console by console
R1#sh mpls traff tun
Name: R1_t0 (Tunnel0) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 3)
path option 5, type explicit R1_R2
Config Parameters:
Bandwidth: 55000 kbps (Global) Priority: 6 6 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 55000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/1, 23
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 0, Tun_Instance 405
RSVP Path Info:
My Address: 14.0.0.1
Explicit Route: 14.0.0.4 34.0.0.4 34.0.0.3 23.0.0.3
23.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=55000 kbits, burst=1000 bytes, peak rate=55000 kbits
History:
Tunnel:
Time since created: 2 hours, 30 minutes
Time since path change: 6 seconds
Number of LSP IDs (Tun_Instances) used: 405
Current LSP:
Uptime: 6 seconds
Prior LSP:
ID: path option 5 [404]
Removal Trigger: path error
Last Error: PCALC:: Can’t use link 12.0.0.1 on node 1.1.1.1
Name: R1_t1 (Tunnel1) Destination: 2.2.2.2
Status:
Admin: up Oper: up Path: valid Signalling: connected
path option 10, type dynamic (Basis for Setup, path weight 1)
Config Parameters:
Bandwidth: 50000 kbps (Global) Priority: 5 5 Affinity: 0x0/0xFFFF
Metric Type: TE (default)
AutoRoute: enabled LockDown: disabled Loadshare: 50000 bw-based
auto-bw: disabled
Active Path Option Parameters:
State: dynamic path option 10 is active
BandwidthOverride: disabled LockDown: disabled Verbatim: disabled
InLabel : –
OutLabel : FastEthernet0/0, implicit-null
RSVP Signalling Info:
Src 1.1.1.1, Dst 2.2.2.2, Tun_Id 1, Tun_Instance 231
RSVP Path Info:
My Address: 12.0.0.1
Explicit Route: 12.0.0.2 2.2.2.2
Record Route: NONE
Tspec: ave rate=50000 kbits, burst=1000 bytes, peak rate=50000 kbits
RSVP Resv Info:
Record Route: NONE
Fspec: ave rate=50000 kbits, burst=1000 bytes, peak rate=50000 kbits
History:
Tunnel:
Time since created: 1 hours, 8 minutes
Time since path change: 8 seconds
Number of LSP IDs (Tun_Instances) used: 231
Current LSP:
Uptime: 8 seconds
Prior LSP:
ID: path option 10 [220]
Removal Trigger: tunnel shutdown
Create a free website or blog at WordPress.com.
Entries and comments feeds.