The route of the primary and backup router

mik0s
mik0s used Ask the Experts™
on
It is necessary to ensure uninterrupted communication with the Internet to AS3333.

R1 and R2 - ASBR connected to two AS (1111 & 2222)
On each router raised two eBGP sessions with each of AS1111 and AS2222.
R1 takes only default route from AS1111 and AS2222.
R2 takes fullview and default routes from AS1111 and AS2222.

R3 - backbone router

R1,2,3 are in OSPF Area0

schemeHardware:

R1 - Cisco 3825 (not enough memory to fullview)
R2 - Vyatta
R3 - Catalyst 3560


Question:

How do you say R3, so that he always used for outgoing routes R2? A route through R1 only in case of failure of R2?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Well it will depends...how is router 3 learning routes outside of your AS? Are you redistributing BGP into OSPF?  For your scenario, I would probably run iBGP with R1, R2, R3.  Within your bgp neighbor statement on R3, you can probably use the weight command to make all routes learned from R2 the preferred

neighbor <bgp peer address of R2>  weigth xxx

The higher the weight the more preferred.   So in the event of R2's BGP peering with AS 1111 and AS222 dies, R3 will no longer receive the iBGP routes from R2. Therefore using R1 as an alternate.

Author

Commented:
Why iBGP instead OSPF?
It should default routes redistributing BGP into OSPF?

Commented:
Looking at your diagram it seems pretty simple as a flat network.  

By default OSPF will not advertise the routes learned by BGP, you need to manually redistribute those routes into OSPF.  

If you use OSPF and redistribute BGP, you will still need to modify incoming routes on R2 and R1 using route policies such as route map to distinguish which will have the better routes.  My network is similar to your design but I have a lot of backend networks and remote sites.  I need to use OSPF for that reason.  I do not see any remote sites or backend networks to warrant using OSPF on your diagram.  I personally dont like to over complicate things if you dont need to.  Its just a matter of preference.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I have a lot of networks in the LAN and VPN pipes on R1 & R2 - I just keep it simple scheme.
Do I understand correctly that R1 should have a higher priority default route on R1, to forward traffic through it?
Can an example to show how to make Cisco BGP redistribution in OSPF?

Commented:
Router 1
router ospf 1
redistribute bgp 3333

Router 2
router ospf 1
redistribute bgp 3333

But because router 1 only receives a default route, thats the only thing that will be redistributed.  Router 2 is where the traffic should all go to...pending on what routes bgp is initially receiving.

Author

Commented:
How do you say R3, so that he always used for outgoing routes R2? A route through R1 only in case of failure of R2?

Commented:
are you only using ospf between r 1, 2, and 3? Or will you put bgp into the mix.  That way I can tell you how to do it

Author

Commented:
Between R1 and R2 - iBGP
R1,R2 and R3 - OSPF area 0

Need to get on R3 the default from iBGP.
Top Expert 2004

Commented:
In OSPF on R1 and R2, add
default-information originate

This will generate a default route that will be visible on R3. OSPF will not pass on a default route without that. Since you want to prefer R2, you should also modify your redistribution into OSPf by setting a default metric on R2 that is lower than on R1:
Router 1
router ospf 1
 redistribute bgp 3333 metric 20
 default-information originate metric 20

Router 2
 router ospf 1
 redistribute bgp 3333 metric 10
 default-information originate metric 10

Author

Commented:
Thank you. Now everything is configure like this:

router ospf 10
 router-id 10.1.0.11
 log-adjacency-changes
 redistribute bgp 3333 metric 20 route-map BGP2OSPF
 network 10.1.0.11 0.0.0.0 area 0
 network 3.3.3.0 0.0.0.255 area 0
 default-information originate metric 20
!
router bgp 3333
 no synchronization
 bgp router-id 10.1.0.11
 bgp log-neighbor-changes
 bgp redistribute-internal
 network 3.3.3.0 mask 255.255.255.0
 neighbor 10.1.0.12 remote-as 3333
 neighbor 10.1.0.12 update-source Loopback1
 neighbor 10.1.0.12 next-hop-self
 neighbor 10.1.0.12 soft-reconfiguration inbound
 neighbor 10.1.0.12 route-map AS3333-in in
 neighbor 10.1.0.12 route-map AS3333-out out
!
!
route-map AS3333-out permit 10
 match ip address 10
!
route-map AS3333-out permit 20
 match ip address 2
!
route-map BGP2OSPF permit 10
 match ip address 2
!
access-list 2 permit 0.0.0.0
access-list 10 permit 3.3.3.0 0.0.0.255

Open in new window


Where IP addresses:
R1 - 10.1.0.11
R2 - 10.1.0.12
R3 - 10.1.0.254

For some reason not given R2 a default route:

R1#sh ip bgp neighbors 10.1.0.12 advertised-routes 
BGP table version is 979, local router ID is 10.1.0.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.0/24  0.0.0.0                  0         32768 i

Total number of prefixes 1

Open in new window


But from R2 takes it right:

R1#sh ip bgp neighbors 10.1.0.12 received-routes 
BGP table version is 979, local router ID is 10.1.0.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
r>i0.0.0.0          10.1.0.12                     500      0 43267 i
* i3.3.3.0/24  10.1.0.12                0    100      0 i

Total number of prefixes 2 

Open in new window


One default route in the OSPF:

R1#sh ip ospf database 

            OSPF Router with ID (10.1.0.11) (Process ID 10)

		Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.0.11       10.1.0.11       785         0x80000162 0x005F54 5
10.1.0.12       10.1.0.12       1004        0x80000447 0x00D7D8 3
10.1.0.254      10.1.0.254      1941        0x80000165 0x0058A3 14

		Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
3.3.3.1  10.1.0.254      1941        0x80000163 0x002FCE

		Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         10.1.0.12       574         0x80000011 0x00F829 0

Open in new window


Checked - turns off all uplinks on R2 and as expected in the OSPF default route does not get :(
What I did wrong?
Top Expert 2004

Commented:
Where is your BGP routes and neighbors from the external ASs? The default route depends on receiving it from them.
Top Expert 2004

Commented:
Also, remove "bgp redistribute-internal" from your BGP configuration. I also don't know why you're controlling your iBGP routes with route maps so tightly. I would remove the route maps also, at least for now while you're testing.

You should be seeing the default route coming from the EBGP neighbors. The current one in BGP is flagged as RIB failure, which means in this case that there is a better route available- either static or OSPF. What is the output of "show ip route?

Author

Commented:
I received the default routes from my two neighbors

R1#sh ip bgp neighbors 82.112.184.101 received-routes 
BGP table version is 979, local router ID is 10.1.0.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
r  0.0.0.0          82.112.184.101                         0 43267 i
         

R1#sh ip bgp neighbors 84.204.76.97 received-routes 
BGP table version is 979, local router ID is 10.1.0.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
r  0.0.0.0          84.204.76.97                           0 20632 i


R1#sh ip bgp summary 
BGP router identifier 10.1.0.11, local AS number 3333
BGP table version is 979, main routing table version 979
235 network entries using 27495 bytes of memory
240 path entries using 12480 bytes of memory
104/3 BGP path/bestpath attribute entries using 12896 bytes of memory
87 BGP AS-PATH entries using 2312 bytes of memory
72 BGP community entries using 1812 bytes of memory
2 BGP extended community entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 57043 total bytes of memory
236 received paths for inbound soft reconfiguration
BGP activity 372/137 prefixes, 771/531 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.0.12       4 3333   11942   11953      979    0    0 09:15:12        1
82.112.184.101  4 43267   13136   11927      979    0    0 1w1d            1
84.204.76.97    4 20632   25616   23851      979    0    0 1w1d            1

Open in new window



Routes on R1:

R1#sh 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 3.3.3.130 to network 0.0.0.0

     84.0.0.0/28 is subnetted, 1 subnets
C       84.204.76.96 is directly connected, GigabitEthernet0/0.32
     82.0.0.0/30 is subnetted, 1 subnets
C       82.112.184.100 is directly connected, GigabitEthernet0/0.34
     10.0.0.0/8 is variably subnetted, 12 subnets, 4 masks
O       10.1.0.12/32 
           [110/11] via 3.3.3.130, 00:07:26, GigabitEthernet0/1.62
O       10.2.0.0/16 
           [110/2] via 3.3.3.129, 00:07:26, GigabitEthernet0/1.62
O       10.3.0.0/16 
           [110/2] via 3.3.3.129, 00:07:26, GigabitEthernet0/1.62
O       10.0.0.0/16 
           [110/2] via 3.3.3.129, 00:07:26, GigabitEthernet0/1.62
S       10.0.0.0/8 [1/0] via 3.3.3.129
C       10.1.0.0/24 is directly connected, Loopback1
O       10.6.0.0/16 
           [110/2] via 3.3.3.129, 00:07:26, GigabitEthernet0/1.62
O       10.7.0.0/16 
           [110/2] via 3.3.3.129, 00:07:26, GigabitEthernet0/1.62
O       10.4.0.0/16 
           [110/2] via 3.3.3.129, 00:07:28, GigabitEthernet0/1.62
O       10.5.0.0/16 
           [110/2] via 3.3.3.129, 00:07:28, GigabitEthernet0/1.62
O       10.255.0.0/16 
           [110/2] via 3.3.3.129, 00:07:28, GigabitEthernet0/1.62
O       10.1.0.254/32 
           [110/2] via 3.3.3.129, 00:07:28, GigabitEthernet0/1.62
O       3.3.3.132/32 
           [110/11] via 3.3.3.130, 00:07:28, GigabitEthernet0/1.62
C       3.3.3.128/29 is directly connected, GigabitEthernet0/1.62
O*E1 0.0.0.0/0 [110/11] via 3.3.3.130, 00:07:28, GigabitEthernet0/1.62
S    3.3.3.0/24 is directly connected, Null0

Open in new window


Where IP address:

R3 - 3.3.3.129
R2 - 3.3.3.130
R1 - 3.3.3.131

That's right - R1 standby router contains only default routes from my neighbors, so now the default route points to the R2. Exactly the same route is present on R3.

I have limited the acceptance of prefixes from the neighbors, because R1 can not accommodate fullview. On R2 into OSPF includes all prefixes fullview and R1 could not stand together with the R3 :) But I'll follow your advice and try to disable the route-map at the time of testing.
Top Expert 2004

Commented:
O*E1 0.0.0.0/0 [110/11] via 3.3.3.130, 00:07:28, GigabitEthernet0/1.62

This is the reason your BGP route is being ignored. Where is that coming from?
Top Expert 2004

Commented:
Also in your bgp, you have
neighbor 10.1.0.12 route-map AS3333-in in

But there is no route-map called AS3333-in

Author

Commented:
Sorry, forgot to specify a route-map in his post. In fact, he is in the configuration.

route-map AS3333-in permit 10
 match ip address 2

Open in new window


Which route is ignored?

Author

Commented:
Any solutions?
Top Expert 2004
Commented:
Sorry, our posts crossed a few days ago and then I never saw the posts after 6/14.

So it looks like R1 is getting a default route from R2 via OSPF. In the OSPF config on R2, did you set the default-information originate metric to 10 instead of 20, as I suggested? If you did, you will only see one default route in R3, from R2, with a metric of 10 (110/10). If that route dies then the one from R1 should show up (110/20). That's how you wanted it, correct?

Try this test: Disconnect R2 from the network. You should now see a default route in BGP on R1 and R3 should have it in OSPF with a metric of 20.

Also, I forgot that you really should add the "subnets" keyword when redistributing into OSPF:
router ospf 1
 redistribute bgp 3333 subnets metric 10
 default-information originate metric 10

You have not provided the EBGP configuration on R1 and R2, so it makes it hard to compare. If I saw full BGP and OSPF configuration from R1,  R2 and R3 it would be a lot more clear.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial