19 Haziran 2017 Pazartesi

IP SLA and Track

R1 router'ı 1.1.1.2 ip'sini 30 sn  ping'leyip erişemezse 10.51.1.2 gw'ini kullanacak. Defaultta Kripto1 default Gw'i. Amac Krıipto1 fa0/0 interface up olsa bile 1.1.1.2 routing yapmıyorsa diğer rotayı izlemek.

R2 router'ı 1.1.1.1 ip'sini 30 sn ping'leyip erişemezse 10.52.1.2 gw'inin kullanacak. Defaultta Kripto2 default Gw'i



R1#show ip sla statistics



track 999 ip sla 999 reachability
 delay down 30 up 20

R1:
Bir sla yazıyorum ve 1.1.1.2 ping'le diyorum arkasından track ile portu takip ediyorum.

ip sla 1
 icmp-echo 1.1.1.2 source-ip 10.51.1.100
 frequency 30
 timeout 2000
 threshold 2000
 exit
ip sla schedule 1 life forever start-time now

track 1 rtr 1 reachability

ip route 1.1.1.0 255.255.255.0 10.51.1.1
ip route 2.2.2.0 255.255.255.0 10.51.1.2
ip route 10.52.1.0 255.255.255.0 10.51.1.2 10
ip route 10.52.1.0 255.255.255.0 10.51.1.1 track 1 (Default gw olarak bu seçtim ama eğer 1.1.1.2 erişemezsen metric 10 olanı kullan dedim, Track ile bu portu izliyorum)


R2: 
ip sla 1
 icmp-echo 1.1.1.1 source-ip 10.52.1.100
 frequency 30
 timeout 2000
 threshold 2000
 exit
ip sla schedule 1 life forever start-time now

track 1 rtr 1 reachability

ip route 1.1.1.0 255.255.255.0 10.52.1.1
ip route 2.2.2.0 255.255.255.0 10.52.1.2
ip route 10.51.1.0 255.255.255.0 10.52.1.2 10
ip route 10.51.1.0 255.255.255.0 10.52.1.1 track 1
-----
R1(config)#ip sla 1 
R1(config-ip-sla)#icmp-echo 192.168.12.2
 R1(config-ip-sla-echo)#timeout 100 
R1(config-ip-sla-echo)#frequency 1 
R1(config-ip-sla-echo)#exit 
R1(config)#ip sla schedule 1 start-time now life forever
R1(config)#track 1 rtr 1



We will ping IP address 192.168.12.2 each second and when we don’t get a response within 100 Ms



****
track 3 ip sla 3
!
track 4 ip sla 4


track 5 list boolean or ( anlamı track 'in up olması ıcın bir tanesi up olması yeterlidir)
 object 3
 object 4

ip route 25.3.43.0 255.255.255.0 10.31.100.23 track 5

 ip sla 3
 icmp-echo 10.32.101.42 source-interface Port-channel2
 frequency 5
ip sla schedule 3 life forever start-time now
ip sla 4
 icmp-echo 10.33.101.42
 frequency 5
ip sla schedule 4 life forever start-time now



----
ip sla 1
 icmp-echo 4.2.2.2 source-interface FastEthernet2/0
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo 4.2.2.2 source-interface FastEthernet3/0
ip sla schedule 2 life forever start-time now
!
track 10 rtr 1 reachability
 delay down 30 up 20
!
track 20 rtr 2 reachability
 delay down 30 up 20
!
access-list 198 permit ip 10.4.4.0 0.0.0.255 any
access-list 199 permit ip 10.3.3.0 0.0.0.255 any
!
route-map LOCAL_TRAFFIC permit 10
 match ip address 199
 set ip next-hop 10.3.3.2
 set interface FastEthernet2/0
!
route-map LOCAL_TRAFFIC permit 20
 match ip address 198
 set ip next-hop 10.4.4.2
 set interface FastEthernet3/0
!
ip local policy route-map LOCAL_TRAFFIC
!
interface FastEthernet2/0
 description Connection to Edge-1 router
 ip address 10.3.3.1 255.255.255.0
 ip ospf 1 area 0
 speed 100
 full-duplex
!
interface FastEthernet3/0
 description Connection to Edge-2 router
 ip address 10.4.4.1 255.255.255.0
 ip ospf 1 area 0
 speed 100
 full-duplex


---
ayrıca interface 'i track ile izleyip shutdown ve no shut yapmak icin

track 2 interface GigabitEthernet0/0 line-protocol

event manager applet INT_SHUT
 event track 2 state down
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "int lo 0"
 action 04 cli command "no shut"
event manager applet INT-NOSHUT
 event track 2 state up
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "int lo 0"
 action 04 cli command "shut"



Komple SLA

hostname Router
!
!
track 1 ip sla 1
!
track 2 ip sla 2
!
track 3 interface Ethernet0/0 line-protocol
!
track 4 interface Ethernet0/1 line-protocol
!
!
!
!
interface Ethernet0/0
 ip address 3.3.3.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly in
!
interface Ethernet0/1
 ip address 4.4.4.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly in
 shutdown
!
interface Ethernet0/2
 ip address 192.168.1.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly in
!
ip nat inside source list R5 interface Ethernet0/0 overload
ip nat inside source list R6 interface Ethernet0/0 overload
ip route 8.8.8.8 255.255.255.255 Ethernet0/0 track 1
ip route 9.9.9.9 255.255.255.255 Ethernet0/1 track 2
ip route 8.8.8.8 255.255.255.255 Ethernet0/1 10
ip route 9.9.9.9 255.255.255.255 Ethernet0/0 10
!
ip access-list extended R5
 permit ip host 192.168.1.100 any
ip access-list extended R6
 permit ip host 192.168.1.101 any
!
ip sla 1
 icmp-echo 3.3.3.2 source-interface Ethernet0/0
 frequency 5
 timeout 2000
 threshold 2000
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo 4.4.4.2 source-interface Ethernet0/1
 frequency 5
 timeout 2000
 threshold 2000
ip sla schedule 2 life forever start-time now
!
!
!
control-plane
!
event manager applet 1_INT_SHUT
 event track 3 state down
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "ip nat inside source list R5 interface Ethernet0/1 overload"
event manager applet 1_INT-NOSHUT
 event track 3 state up
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "ip nat inside source list R5 interface Ethernet0/0 overload"
event manager applet 2_INT_SHUT
 event track 4 state down
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "ip nat inside source list R6 interface Ethernet0/0 overload"
event manager applet 2_INT-NOSHUT
 event track 4 state up
 action 01 cli command "enable"
 action 02 cli command "conf t"
 action 03 cli command "ip nat inside source list R6 interface Ethernet0/1 overload"
!       
end

R1(config)#ip sla monitor 1
R1(config-sla-monitor)#type echo protocol ipIcmpEcho 192.168.33.33
R1(config-sla-monitor-echo)#timeout 2000
R1(config-sla-monitor-echo)#threshold 2000
R1(config-sla-monitor-echo)#frequency 10



Pıng ile event Manager

ip sla 11
 icmp-echo 4.4.4.4 source-interface GigabitEthernet2/5
ip sla schedule 11 life forever start-time now
ip sla reaction-configuration 11 react timeout threshold-type immediate
ip sla enable reaction-alerts

track 11 ip sla 11 reachability
 delay down 8 up 10

event manager applet shut_int
 event ipsla operation-id 11 reaction-type timeout
 action 1.0 if $_ipsla_condition eq "Occurred"
 action 1.1  cli command "enable"
 action 1.2  cli command "conf t"
 action 1.3  cli command "interface gi1/1"
 action 1.4  cli command "shut"
 action 1.5  syslog msg "End of EEM"
 action 1.6 end

Hiç yorum yok:

Yorum Gönder