@ALEXLEMUR
Инженер

Как исправить проблему с IP SLA?

877db253892146b098406a77a844cd2b.PNG
Настраивая в лабараторной среде IP SLA Столкнулся с такой проблемой.
При одной конфигурации все работает при второй нет, как раз вторая и нужна, так как от провайдеров приходят ip и маршруты по DHCP. (Жирным шрифтом то что менялось)

1) Вариант.
2911#show running-config
Building configuration...
!
ip dhcp pool INET
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
domain-name wr
lease 0 2
!
!
no ip domain lookup
ip sla monitor 20
type echo protocol ipIcmpEcho 20.20.20.1 source-ipaddr 20.20.20.2
frequency 5
ip sla monitor schedule 20 life forever start-time now
ip sla monitor 30
type echo protocol ipIcmpEcho 30.30.30.1 source-ipaddr 30.30.30.2
frequency 5
ip sla monitor schedule 30 life forever start-time now
ip sla monitor 40
type echo protocol ipIcmpEcho 40.40.40.1 source-ipaddr 40.40.40.2
ip sla monitor schedule 40 life forever start-time now
ip sla monitor 50
type echo protocol ipIcmpEcho 50.50.50.1 source-ipaddr 50.50.50.2
ip sla monitor schedule 50 life forever start-time now

!
!
!
track 20 rtr 20
delay down 5 up 5
!
track 30 rtr 30
delay down 5 up 5
!
track 40 rtr 40
delay down 5 up 5
!
track 50 rtr 50
delay down 5 up 5
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 20.20.20.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 30.30.30.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 40.40.40.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address dhcp
ip nat outside
!
interface FastEthernet0/0.50
encapsulation dot1Q 50
ip address 172.16.34.1 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 10.10.10.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 20.20.20.1 10 track 20
ip route 0.0.0.0 0.0.0.0 30.30.30.1 20 track 30
ip route 0.0.0.0 0.0.0.0 40.40.40.1 30 track 50
ip route 0.0.0.0 0.0.0.0 50.50.50.1 40 track 50

!
!
ip nat inside source route-map 3G_router interface FastEthernet0/0.30 overload
ip nat inside source route-map Provod_inet interface FastEthernet0/0.40 overload
ip nat inside source route-map SPUTNIK interface FastEthernet0/0.10 overload
ip nat inside source route-map WiMAX interface FastEthernet0/0.20 overload
!
ip access-list extended NAT_pool
permit ip 192.168.1.0 0.0.0.255 any
permit ip 10.10.10.0 0.0.0.255 any
!
no cdp log mismatch duplex
route-map 3G_router permit 10
match ip address NAT_pool
match interface FastEthernet0/0.30
!
route-map SPUTNIK permit 10
match ip address NAT_pool
match interface FastEthernet0/0.10
!
route-map WiMAX permit 10
match ip address NAT_pool
match interface FastEthernet0/0.20
!
route-map Provod_inet permit 10
match ip address NAT_pool
match interface FastEthernet0/0.40
!
!
!
!
end

2) Вариант
2911#show running-config

hostname 2911
!
ip dhcp pool INET
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
domain-name wr
lease 0 2
!
ip sla monitor 20
type echo protocol ipicmpEcho 20.20.20.1 source-inter fa0/0.10
frequency 5
ip sla monitor schedule 20 life forever start-time now
ip sla monitor 30
type echo protocol ipicmpEcho 30.30.30.1 source-inter fa0/0.20
frequency 5
ip sla monitor schedule 30 life forever start-time now
ip sla monitor 40
type echo protocol ipicmpEcho 40.40.40.1 source-inter fa0/0.30
ip sla monitor schedule 40 life forever start-time now
ip sla monitor 50
type echo protocol ipicmpEcho 50.50.50.1 source-inter fa0/0.40
ip sla monitor schedule 50 life forever start-time now

!
!
!
!
track 20 rtr 20
delay down 5 up 5
!
track 30 rtr 30
delay down 5 up 5
!
track 40 rtr 40
delay down 5 up 5
!
track 50 rtr 50
delay down 5 up 5
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 20.20.20.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 30.30.30.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 40.40.40.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address dhcp
ip nat outside
!
interface FastEthernet0/0.50
encapsulation dot1Q 50
ip address 172.16.34.1 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 10.10.10.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 Fa 0/0.10 10 track 20
ip route 0.0.0.0 0.0.0.0 Fa 0/0.20 20 track 30
ip route 0.0.0.0 0.0.0.0 Fa 0/0.30 30 track 40
ip route 0.0.0.0 0.0.0.0 Fa 0/0.40 40 track 50

!
!
ip nat inside source route-map 3G_router interface FastEthernet0/0.30 overload
ip nat inside source route-map Provod_inet interface FastEthernet0/0.40 overload
ip nat inside source route-map SPUTNIK interface FastEthernet0/0.10 overload
ip nat inside source route-map WiMAX interface FastEthernet0/0.20 overload
!
ip access-list extended NAT_pool
permit ip 192.168.1.0 0.0.0.255 any
permit ip 10.10.10.0 0.0.0.255 any
!
no cdp log mismatch duplex
route-map 3G_router permit 10
match ip address NAT_pool
match interface FastEthernet0/0.30
!
route-map SPUTNIK permit 10
match ip address NAT_pool
match interface FastEthernet0/0.10
!
route-map WiMAX permit 10
match ip address NAT_pool
match interface FastEthernet0/0.20
!
route-map Provod_inet permit 10
match ip address NAT_pool
match interface FastEthernet0/0.40
!
!
!
end

Проблема в том что во втором варианте после переключения маршрута трафик от клиента VipNET и Wi-Fi роутера отказывается ходить по новому маршруту до ip 100.100.100.100 если он хоть раз прошолся по старому.

P.S В тавлице маршрутизации маршрут по умолчанию всегда остается один здесь все срабатывает правильно. Да и вообще вроде все срабатывает правильно но при втором варианте не работает.

Подскажите в чем может быть проблема.
  • Вопрос задан
  • 1143 просмотра
Пригласить эксперта
Ответы на вопрос 1
@MrPurrPurr
1. Попробуйте почистить таблицу NAT трансляций после изменения статуса трека. Мы делали это через EEM, например:
event manager applet Clear_NAT_Translation_1
event track 1 state any
action 1.0 cli command "enable"
action 2.0 cli command "clear ip nat translation forced"

2. Можно повесить трек не на раут, а на DHCP на интерфейсе так:
interface GigabitEthernet0/0
ip dhcp client route track 1
ip address dhcp
ip nat outside

upd: при этом сам раут прописывается при этом тем же EEM:
event manager applet DHCP_up
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 dhcp 2"

К сожалению, без такого костыля решить проблему не удалось.
Сталкивался с аналогичной проблемой, у нас помогло включение обоих вариантов. Первый нужен скорее для того, что бы не залипали трансляции от VipNet - они это любят.

Прошу прощения за правки постоянные - первый раз отвечаю тут. Лучше приведу целиком конфиг наш:
track 1 ip sla 1 reachability
delay down 12
!
track 2 ip sla 2 reachability
delay down 12
!
track 3 ip sla 3 reachability
delay down 12

interface GigabitEthernet0/0.4
description Internet_for_users
encapsulation dot1Q 4
ip address 192.168.15.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/0.6
description To_VipNet_IN
encapsulation dot1Q 6
ip address 10.254.75.97 255.255.255.248
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/0.40
description Internet_UzelPrivazki_LR
encapsulation dot1Q 40
ip address 10.0.0.9 255.255.255.248
ip nat outside
ip virtual-reassembly in
!
interface GigabitEthernet0/0.43
description Internet_UzelPrivazki
encapsulation dot1Q 43
ip dhcp client route track 3
ip address dhcp
ip nat outside
ip virtual-reassembly in
!
interface GigabitEthernet0/0.99
description TECH
encapsulation dot1Q 99
ip address 172.16.0.1 255.255.255.252
!
interface GigabitEthernet0/1
description Internet_LR77
ip address 10.0.0.2 255.255.255.248
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
ip nat inside source route-map nat2dhcp interface GigabitEthernet0/0.43 overload
ip nat inside source route-map nat2dhcpPOSH interface GigabitEthernet0/0.44 overload
ip nat inside source route-map nat2lr interface GigabitEthernet0/1 overload
ip nat inside source route-map nat2uzel interface GigabitEthernet0/0.40 overload
ip route 0.0.0.0 0.0.0.0 10.0.0.1 25 track 1
ip route 0.0.0.0 0.0.0.0 10.0.0.10 27 track 2
ip route 8.8.4.4 255.255.255.255 10.0.0.10
ip route 77.88.8.8 255.255.255.255 10.0.0.1
ip route 4.2.2.3 255.255.255.255 dhcp
ip route 0.0.0.0 0.0.0.0 dhcp 2
!
ip sla auto discovery
ip sla 1
icmp-echo 77.88.8.8 source-interface GigabitEthernet0/1
threshold 2000
timeout 2000
frequency 5
ip sla schedule 1 life forever start-time now
ip sla 2
icmp-echo 8.8.4.4 source-interface GigabitEthernet0/0.40
threshold 2000
timeout 2000
frequency 5
ip sla schedule 2 life forever start-time now
ip sla 3
icmp-echo 4.2.2.3 source-interface GigabitEthernet0/0.43
threshold 2000
timeout 2000
frequency 5
ip sla schedule 3 life forever start-time now
!
route-map nat2uzel permit 10
match ip address 111
match interface GigabitEthernet0/0.40
!
route-map nat2dhcp permit 10
match ip address 111
match interface GigabitEthernet0/0.43
!
route-map nat2lr permit 10
match ip address 111
match interface GigabitEthernet0/1
!
!
access-list 111 permit ip 192.168.15.0 0.0.0.255 any
access-list 111 permit ip 10.254.75.0 0.0.0.255 any
!
control-plane
!
!
!
line con 0
login local
line aux 0
line 2
no activation-character
no exec
transport preferred none
transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
stopbits 1
line vty 0 4
access-class 23 in
privilege level 15
login local
transport input telnet ssh
line vty 5 15
access-class 23 in
privilege level 15
login local
transport input telnet ssh
!
scheduler allocate 20000 1000
event manager applet Clear_NAT_Translation_1
event track 1 state any
action 1.0 cli command "enable"
action 2.0 cli command "clear ip nat translation forced"
event manager applet Clear_NAT_Translation_2
event track 2 state any
action 1.0 cli command "enable"
action 2.0 cli command "clear ip nat translation forced"
event manager applet Clear_NAT_Translation_3
event track 3 state any
action 1.0 cli command "enable"
action 2.0 cli command "clear ip nat translation forced"
event manager applet DHCP_up
event track 3 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 dhcp 2"
event manager applet DHCP_down
event track 3 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 dhcp 2"

здесь 2 аплинка по статике и 1 по DHCP.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы