Home Blog Certs Knowledge Base About

Cisco ISP Connection & PBR

Cisco IOS cheat sheet for ISP connectivity: dual-ISP failover without BGP (IP SLA + tracking), dynamic NAT switching, multihomed BGP with two CE routers, PPPoE client, and Policy-Based Routing (PBR).

IP SLA โ€” Availability Monitoring

Used to detect ISP link failure and trigger route switching.

IP SLA โ€” Method 1 (modern IOS)
CommandDescription
ip sla 1Create SLA probe 1
icmp-echo 20.0.1.2 source-interface e0/2Ping ISP1 next-hop from interface e0/2
frequency 10Probe every 10 seconds
ip sla schedule 1 start-time now life foreverStart probe immediately, run indefinitely
track 1 ip sla 1 reachabilityTrack object 1 = SLA 1 reachability
ip route 0.0.0.0 0.0.0.0 2.2.2.2 track 1Use ISP1 as default when probe succeeds
ip route 0.0.0.0 0.0.0.0 3.3.3.3 10Fallback to ISP2 with higher AD (10) when probe fails
show track 1Show tracking object status
IP SLA โ€” Method 2 (legacy IOS)
CommandDescription
ip sla monitor 1Create SLA monitor
type echo protocol IpIcmpEcho 20.0.1.2 source-interface e0/2ICMP echo probe
frequency 10Probe every 10 seconds
ip sla monitor schedule 1 life forever start-time nowActivate probe
track 1 rtr 1 reachabilityTrack SLA reachability (legacy syntax)

You can monitor an external resource instead of the ISP next-hop, but then you must route traffic to that resource exclusively through ISP1 to get accurate results:
ip route 85.202.241.71 255.255.255.255 <isp1-next-hop>


Dynamic NAT Failover (Single CE, Dual ISP)

Problem: each ISP allows NAT only from the IP it assigned. With two ISPs and one router, NAT rules must switch automatically.

NAT for ISP1
CommandDescription
route-map ISP1 permit 10Match traffic exiting via ISP1 interface
match interface e0/1ISP1 outbound interface
ip nat pool ovrld 217.145.14.4 217.145.14.4 netmask 255.255.255.0ISP1 public IP pool
ip nat inside source route-map ISP1 pool ovrld overloadNAT with route-map โ€” translates to ISP1 IP when ISP1 is active
NAT for ISP2
CommandDescription
route-map ISP2 permit 10Match traffic exiting via ISP2 interface
match interface e0/2ISP2 outbound interface
ip nat pool ovrld2 147.54.76.4 147.54.76.4 netmask 255.255.255.0ISP2 public IP pool
ip nat inside source route-map ISP2 pool ovrld2 overloadNAT to ISP2 IP when ISP2 is active

With two routers (HSRP/VRRP): no route-map needed. Each router handles its own NAT; FHRP determines which router is active.


BGP Multihomed โ€” Dual CE Routers

When both CE routers advertise the same PI prefix to two ISPs, return traffic may arrive via the wrong CE (breaking NAT). Solution: the standby CE conditionally suppresses its advertisement when the primary ISP is reachable.

Conditional Advertisement (Standby CE)
CommandDescription
ip prefix-list NONEXIST seq 5 permit 1.2.3.0/24Match the special route advertised by primary ISP (health signal)
ip prefix-list our-network seq 5 permit 147.45.67.34/24Our PI address block
route-map NONEXIST_MAP permit 10Trigger: fires when health signal route exists
match ip address prefix-list NONEXISTMatch the health signal
route-map ournets permit 100Always-permit route-map for our prefix
match ip address prefix-list our-networkMatch our PI block
router bgp 65100Enter BGP context
neighbor 132.56.43.21 route-map ournets outAdvertise our prefix to backup ISP
neighbor 132.56.43.21 advertise-map ournets non-exist-map NONEXIST_MAPOnly advertise our prefix to backup ISP when health signal is ABSENT

PPPoE Client Configuration

Step 1 โ€” Create Dialer Interface
CommandDescription
interface Dialer1Create Dialer interface
ip address negotiatedGet IP from ISP via PPPoE
ip mtu 1492Set MTU to PPPoE max (1500 - 8 byte overhead)
ip nat outsideMark as NAT outside
encapsulation pppUse PPP encapsulation
dialer pool 1Assign to dialer pool 1
ppp authentication chap callinCHAP authentication toward ISP
ppp chap hostname MaycalPPPoE username
ppp chap password 0 Ghd%4gdnsPPPoE password
Step 2 โ€” Bind Physical Interface to Dialer Pool
CommandDescription
interface FastEthernet0/1Physical interface toward ISP
pppoe-client dial-pool-number 1Link physical interface to Dialer1 via pool 1
Step 3 โ€” Default Route and NAT
CommandDescription
ip route 0.0.0.0 0.0.0.0 dialer 1Default route through Dialer interface
access-list 1 permit 192.168.0.0 0.0.255.255Define private IP range for NAT
ip nat inside source list 1 interface dialer 1 overloadPAT: translate to Dialer interface IP

Policy-Based Routing (PBR)

Route traffic based on source IP, destination, or protocol โ€” overriding the normal routing table.

PBR Configuration
CommandDescription
ip access-list extended CTRL-ACLCreate ACL to match traffic for PBR
permit ip host 192.168.1.2 anyMatch traffic from specific host
route-map CONTROL-RMCreate route-map for PBR
match ip address CTRL-ACLTrigger when ACL matches
set ip next-hop 10.0.2.1Override next-hop for matched traffic
int fa0/1Interface facing the end user
ip policy route-map CONTROL-RMApply PBR route-map on the interface
PBR Diagnostics
CommandDescription
show route-mapShow route-map configuration
show ip policyInterfaces with PBR applied
debug ip policyReal-time PBR matching output

Cisco IOS Command Reference | ISP Connectivity & PBR