Backup link on Cisco: IP SLA and track
Automatic switch to the second ISP when the internet goes down.
Ready IOS commands with NAT on both links, verification and rollback.
Automatic switch to the second ISP when the internet goes down.
Ready IOS commands with NAT on both links, verification and rollback.
The router pings addresses on the internet through the primary ISP and, if they stop answering, moves the default route to the second ISP by itself. Ready IOS and IOS XE commands with NAT on both links, verification and rollback.
The commands are built in your browser; addresses are not sent anywhere.
When a router has two ISPs, a plain default route does not notice that the internet behind the primary link is gone: the cable is in, the gateway answers, and nothing lies beyond. IP SLA pings addresses on the internet through the primary ISP every few seconds, a track object follows the result, and the default route via the primary gateway stays only while the track is Up. When the checks stop answering, the route leaves the table and traffic takes the backup — a floating route with a higher distance.
configure terminal mode, test the switchover and save: copy running-config startup-config.Each address to check gets its own ip sla sourced from the primary ISP's interface and a route to that address only via the primary gateway (with a fallback route to Null0, so the check never succeeds through the backup link and brings the primary back by mistake). With two addresses the track is a list boolean or: the switch happens only when both are silent. NAT uses two route-maps with match interface, and an EEM applet clears translations when the link changes. For MikroTik the dual ISP generator does the same, and port forwarding on Cisco is in NAT and port forwarding.
The gateway usually sits in the ISP's rack next door and answers ping even when the ISP has lost its own connection to the world. Check an address far out on the internet — a public DNS server, for example — and preferably two from different companies.
The generator needs the gateway address: show dhcp lease shows it, and it usually does not change. If it does change, Cisco offers ip dhcp client route track on the interface — it must be entered before ip address dhcp, and the DHCP route will then depend on the track.
Old NAT translations keep sending replies through the failed link until they expire. That is what the EEM applet in the configuration is for: it runs clear ip nat translation * on every state change. Manually, the same command in enable mode does it.
No. ASA uses sla monitor and route … track with a different syntax, and NAT is set up with object network. The generator is for IOS and IOS XE routers: ISR, the 800, 1900, 2900 and 4000 series, Catalyst 8000 and others.