2

enter image description here

ISP - Sending default route to sw1/2 via eBGP

sw1 - config

router ospf 100
 network 0.0.0.0 255.255.255.255 area 0
 default-information originate always
!         
router bgp 100
 bgp log-neighbor-changes
 network 70.70.70.0 mask 255.255.255.0
 timers bgp 10 30
 redistribute ospf 100
 neighbor 74.74.74.1 remote-as 200
 neighbor 192.168.1.19 remote-as 100
 neighbor 192.168.1.19 update-source Loopback0
 neighbor 192.168.1.19 next-hop-self

sw2 - config

router ospf 100
 network 0.0.0.0 255.255.255.255 area 0
 default-information originate always
!
router bgp 100
 bgp log-neighbor-changes
 network 70.70.70.0 mask 255.255.255.0
 timers bgp 10 30
 redistribute ospf 100
 neighbor 64.64.64.1 remote-as 200
 neighbor 192.168.1.20 remote-as 100
 neighbor 192.168.1.20 update-source Loopback0
 neighbor 192.168.1.20 next-hop-self
!

sw3 - config

router ospf 100
 network 0.0.0.0 255.255.255.255 area 0

Question:

Everything is working fine at this point and my route tables look like following on sw3

sw1 - 10.0.0.5 
sw2 - 10.0.0.10

You can see its load-balancing traffic.

Gateway of last resort is 10.0.0.10 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 10.0.0.10, 00:35:37, GigabitEthernet0/3
                [110/1] via 10.0.0.5, 00:35:47, GigabitEthernet0/1

Now i go ahead and shutdown sw1 interface A (ISP side interface)

and then i am seeing following routing table on sw3 if you notice my default gateway is now 10.0.0.5 and 10.0.0.10 disappeared so now my traffic flowing like this

sw3-->sw1-->sw2-->ISP

Gateway of last resort is 10.0.0.5 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 10.0.0.5, 00:39:04, GigabitEthernet0/1
      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

Can someone explain why OSPF picking long path here instead of sending traffic to 10.0.0.10 (sw2) it is sending to (sw1)?

EDIT

OSPF database output:

sw1#sh ip ospf database 

            OSPF Router with ID (200.200.200.1) (Process ID 100)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
70.70.70.1      70.70.70.1     219         0x80000004 0x00756F 3
192.168.1.19    192.168.1.19    1320        0x80000005 0x007C09 4
200.200.200.1   200.200.200.1   22          0x80000007 0x006B44 5

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.0.1        200.200.200.1   240         0x80000002 0x004BB1
10.0.0.5        200.200.200.1   240         0x80000002 0x00EE3B
10.0.0.10       192.168.1.19    198         0x80000002 0x00855B

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         192.168.1.19    1317        0x80000001 0x00C946 100
0.0.0.0         200.200.200.1   13          0x80000001 0x001369 100

BGP command output: 192.168.1.19 & 192.168.1.20 are loopback interface for iBGP

sw1 - BGP

sw1#sh ip bgp 
BGP table version is 43, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  0.0.0.0          74.201.98.1              0             0 200 ?
 * i                  192.168.1.19             0    100      0 200 ?
 * i 10.0.0.0/30      192.168.1.19             0    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 10.0.0.4/30      192.168.1.19             2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.0.8/30      10.0.0.6                 2         32768 ?
 * i                  192.168.1.19             0    100      0 ?
 *>  64.64.64.0/30    10.0.0.2                 2         32768 ?
 * i                  192.168.1.19             0    100      0 ?
 * i 70.64.196.0/24   192.168.1.19             2    100      0 ?
 *>                   10.0.0.6                 2         32768 ?
 * i 74.74.74.0/30   192.168.1.19             2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
     Network          Next Hop            Metric LocPrf Weight Path
 r>i 192.168.1.19/32  192.168.1.19             0    100      0 ?
 *>  192.168.1.20/32  0.0.0.0                  0         32768 ?
 *>  200.200.200.0    0.0.0.0                  0         32768 ?
 r>i 200.200.200.1/32 192.168.1.19             2    100      0 ?
 *>  202.1.1.0        74.74.74.1              0             0 200 i
 * i                  192.168.1.19             0    100      0 200 i
 *>  202.202.202.0    74.74.74.1              0             0 200 i
 * i                  192.168.1.19             0    100      0 200 i

sw2 - BGP

sw2#sh ip bgp 
BGP table version is 37, local router ID is 192.168.1.19
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 * i 0.0.0.0          192.168.1.20             0    100      0 200 ?
 *>                   64.64.64.1               0             0 200 ?
 * i 10.0.0.0/30      192.168.1.20             0    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.0.4/30      10.0.0.9                 2         32768 ?
 * i                  192.168.1.20             0    100      0 ?
 * i 10.0.0.8/30      192.168.1.20             2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 64.64.64.0/30    192.168.1.20             2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 70.70.70.0/24   192.168.1.20             2    100      0 ?
 *>                   10.0.0.9                 2         32768 ?
 *>  74.74.74.0/30   10.0.0.1                 2         32768 ?
 * i                  192.168.1.20             0    100      0 ?
     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.1.19/32  0.0.0.0                  0         32768 ?
 r>i 192.168.1.20/32  192.168.1.20             0    100      0 ?
 *>i 200.200.200.0    192.168.1.20             0    100      0 ?
 *>  200.200.200.1/32 10.0.0.1                 2         32768 ?
 * i 202.1.1.0        192.168.1.20             0    100      0 200 i
 *>                   64.64.64.1               0             0 200 i
 * i 202.202.202.0    192.168.1.20             0    100      0 200 i
 *>                   64.64.64.1               0             0 200 i
1
  • Please provide the full configurations of S1,2 and 3. I don't think you are set up the way you think.
    – Ron Trunk
    Mar 5, 2018 at 16:10

1 Answer 1

3

I think your problem lies with the always keyword:

default-information originate always

That will always inject a default route into OSPF from that router. As I understand your situation from previous questions/chats, you are receiving a default route from your ISP. If you leave off the always keyword, then the router will only inject the default route into OSPF when it already exists in the routing table:

default-information originate

If you are receiving the default route from the ISP then your router will only inject the default route from the ISP into OSPF when the connection to the ISP is up.

10
  • I will send you info as soon as i get access of my lab, i will remove always option and will see what is the result, but still i don't understand logic behind this
    – Satish
    Mar 5, 2018 at 18:30
  • DAMN!!!!!!! you are 100000% right, as soon as i removed always it fixed my issue and working the way i want :) Thanks man!!!! I get your point here but still i am little confused in your answer can you explain bit more why OSPF doing that?
    – Satish
    Mar 5, 2018 at 19:05
  • The WAN router will no longer have a default route that it originates into OSPF from the ISP. I think all your switches are in the same OSPF area, so they should have full knowledge of all the routers and connections to the routers in the area. With the always keyword, the router is always saying that it has a direct connection to the default route, even when it doesn't.
    – Ron Maupin
    Mar 5, 2018 at 19:09
  • 1
    @Satish I would like to see the full IP and Interface/VLAN configuration all switches SW1, SW2 and SW3. Do you see the iBGP link between SW1 and SW2 in the routing table of SW3? You can make a simple lab with SW1, SW2 and SW3 only to see if the output is different or not?
    – Hung Tran
    Mar 5, 2018 at 19:28
  • 1
    @HungTran, but the E2 would be coming from Switch3 to Switch1, and Switch3 would know that. The default route from Switch2 to Switch1 would be through iBGP, with a higher AD than the OSPF default route from Switch3, so Switch1 will use the OSPF default route from Switch3, not the default route from Switch2 via iBGP.
    – Ron Maupin
    Mar 5, 2018 at 19:35

Your Answer

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

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