4

I've got a Cisco 877 ADSL router from which I advertise a default route via OSPF to our central router. It also does a standard ADSL / PPP connection to one of our ISPs. What I want is to advertise the default route only when PPP is up. If it goes down stop advertising 0.0.0.0/0. We don't get a BGP or OSPF feed over that ADSL so I can't simply redistribute what I receive. Is that doable?

Here is the PPP config:

interface Dialer0
 ip address negotiated
 ip access-group INTERNET-IN in
 no ip redirects
 no ip unreachables
 ip mtu 1492
 ip nat outside
 ip inspect INTERNET out
 ip virtual-reassembly
 encapsulation ppp
 dialer pool 1
 no cdp enable
 ppp authentication pap callin
 ppp pap sent-username ...
 ppp ipcp route default

And here is the OSPF config:

router ospf 1
 log-adjacency-changes
 redistribute static subnets route-map ospf_tcl
 network 192.168.128.0 0.0.15.255 area 1
 default-information originate metric 1

route-map ospf_tcl permit 10
 match ip address prefix-list adsl_defroute

ip prefix-list adsl_defroute seq 5 permit 0.0.0.0/0
ip prefix-list adsl_defroute seq 10 permit 192.168.128.0/20

Thanks!

UPDATE based on the comments below...

The main router has one other internet link (SHDSL) through a different ISP with BGP feed of national prefixes. The ADSL link (slow, cheap data) via Cisco 877 is primarily used for international traffic and the SHDSL link (fast, expensive data) for national traffic (welcome back to the 90's - that's what we get on a remote pacific island ;) However in the even of one link going down I want to automatically fail over all traffic to the other link. At the moment it requires a manual intervention on the main router manually replacing the default route.

The goal is to have under normal circumstances a higher metric default route over SHDSL, lower metric default route via ADSL and a bunch of more specific national routes via SHDSL. That part already works, just the default routes updating doesn't.

Here are the static routes from the Cisco box:

#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 218.101.y.y to network 0.0.0.0

C    192.168.128.0/24 is directly connected, Vlan128
     203.97.x.0/32 is subnetted, 1 subnets
C       203.97.x.x is directly connected, Dialer0
     218.101.y.0/32 is subnetted, 1 subnets
C       218.101.y.y is directly connected, Dialer0
S*   0.0.0.0/0 [1/0] via 218.101.y.y
S    192.168.128.0/20 [1/0] via 192.168.128.221

The main router is connected over Vlan128.

Thanks!

4
  • How is this and the central router connected? Where does this router learn the default route from?
    – Daniel Dib
    Commented Aug 15, 2014 at 4:49
  • Actually I was hoping to see show runn | i ip route, in other words, how exactly did you configure your static routes Commented Aug 15, 2014 at 9:39
  • @MikePennington The only static one from that command is ip route 192.168.128.0 255.255.240.0 192.168.128.221 - I guess the 0.0.0.0/0 one is inserted by the Dialer0/PPP process.
    – MLu
    Commented Aug 15, 2014 at 9:45
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 8, 2017 at 21:46

1 Answer 1

3

Change your static route to use the interface as well as the next hop. That way, when the interface goes down, the route will be removed and no longer advertised over OSPF.

no ip route 0.0.0.0 0.0.0.0 218.101.y.y  

ip route 0.0.0.0 0.0.0.0 218.101.y.y Dialer0

You should also remove the redistribute command -- it's not needed

4
  • The 0.0.0.0/0 route is added automatically when the PPP on Dialer0 goes up. Also the 218.101.y.y is assigned by the ISP and can change on every PPP renegotiation. I don't think I should put it there as a static route...
    – MLu
    Commented Aug 15, 2014 at 23:09
  • 1
    In that case, removing the redistribute command is all you need. OSPF will originate the default route only if its in the routing table.
    – Ron Trunk
    Commented Aug 16, 2014 at 2:15
  • That's what I was thinking as well. If you receive the default via PPP, you already have your solution. The default will disappear when the link goes down.
    – Daniel Dib
    Commented Aug 16, 2014 at 17:44
  • Thanks guys will remove the redistribute and give it a try in the next few days.
    – MLu
    Commented Aug 17, 2014 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.