09-04-2011 04:51 PM - edited 03-04-2019 01:30 PM
Hello,
I'm working on a practice lab and am having the following issue
I have a customer router connected to two different ISP routers. Each ISP router must advertise a default through BGP to the customer and one of the default routes must be prefered over the other. Given if the perfered route interface is shut down the other default route is inserted into the routing table and when the perfered default route interface it turned back on that path is used again. The catch is I cant alter the customer router only the the two ISP devices. I tried doing some route maps but im lost. I have deleted all my route maps and have posted the BGP portion of the ISP routers
router bgp 300
no synchronization
bgp log-neighbor-changes
network 10.1.3.0 mask 255.255.255.0
network 183.3.3.0 mask 255.255.255.0
network 183.3.4.0 mask 255.255.255.0
redistribute static
neighbor 10.1.23.2 remote-as 200
neighbor 10.1.23.2 default-originate
neighbor 10.1.23.2 route-map route-to-customer out
no auto-summary
router bgp 100
no synchronization
bgp log-neighbor-changes
network 10.1.1.0 mask 255.255.255.0
network 191.1.1.0 mask 255.255.255.0
network 191.1.2.0 mask 255.255.255.0
redistribute static
neighbor 10.1.12.2 remote-as 200
neighbor 10.1.12.2 default-originate
no auto-summary
any direction or help would be benificial i have been on this for the last day or so.
09-04-2011 05:15 PM
One way to it is
Create a static default rote to null 0 in the less preferred ISP
Ip route 0.0.0.0 0.0.0.0 null0
Ip prefix-list pref1 permit 0.0.0.0/0
Route-map default
Match ip add prefix-list pref1
Route-map OUT
Match ip add prefix-list pref1
Set as-path prepend 300 300
Assuming this config in as 300 router
Router bgp 300
Redistribute static route-map default
Neighbor customerbgp ip route-map out OUT
HTH
Sent from Cisco Technical Support iPhone App
09-04-2011 06:13 PM
Thanks for the help but the issue I face now is once i shut down the perfered default routes outgoing interface and bring it back up the alternate default route stays in the routing table. I need to be able to shut down the perfered out going interface and bring it back and able to replace the alternate route in the customer device with the perfered route.
router bgp 300
no synchronization
bgp log-neighbor-changes
network 10.1.3.0 mask 255.255.255.0
network 183.3.3.0 mask 255.255.255.0
network 183.3.4.0 mask 255.255.255.0
redistribute static route-map default
neighbor 10.1.23.2 remote-as 200
neighbor 10.1.23.2 default-originate
neighbor 10.1.23.2 route-map route out
no auto-summary
!
ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 Null0
!
!
!
ip prefix-list pref1 seq 5 permit 0.0.0.0/0
route-map default permit 10
match ip address prefix-list pref1
!
route-map route permit 10
match ip address prefix-list pref1
set as-path prepend 300 300
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
09-04-2011 06:39 PM
can you wait for 5 to 10 minute and see if dose show up through the preferred route when you bring it back
just to make sure the BGP route get converged
also you can check if the router is advertising the route to the customer router using the bellow command
show ip bgp neighbor 10.1.23.2 advertised-route
and see if the defaulte route got advertised or not
HTH
if helpful Rate
09-04-2011 06:41 PM
the other way is
remove the static to null0
remove the redistribtion and keep the AS prepend route map
add the default originate command
rest the BGP session and check the propigation of the default route
09-04-2011 06:53 PM
Ok I will go ahead and wait then for a few minutes, quick question though is the 0.0.0.0 next hop 10.1.23.3. suppose to only show the path as 300 since I made the changes on R3.
R2#show ip bgp
BGP table version is 11, local router ID is 202.2.2.1
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
* 0.0.0.0 10.1.23.3 0 300 i
*> 10.1.12.1 0 100 i
*> 10.1.1.0/24 10.1.12.1 0 0 100 i
*> 10.1.2.0/24 0.0.0.0 0 32768 i
*> 10.1.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.4.0/24 10.1.23.3 0 0 300 i
*> 191.1.1.0/24 10.1.12.1 0 0 100 i
*> 191.1.2.0/24 10.1.12.1 0 0 100 i
*> 202.2.2.0 0.0.0.0 0 32768 i
09-04-2011 07:50 PM
based on the change you made it has to show only through 12.1 not 23.3
can you please post the routers config three of them with ip bgp in each of them
09-04-2011 07:56 PM
Thank you again for all your help,
R1#show run
Building configuration...
Current configuration : 1243 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
!
!
!
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Loopback1
ip address 191.1.1.1 255.255.255.0
!
interface Loopback2
ip address 191.1.2.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.1.12.1 255.255.255.0
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router bgp 100
no synchronization
bgp log-neighbor-changes
network 10.1.1.0 mask 255.255.255.0
network 191.1.1.0 mask 255.255.255.0
network 191.1.2.0 mask 255.255.255.0
redistribute static
neighbor 10.1.12.2 remote-as 200
neighbor 10.1.12.2 default-originate
no auto-summary
!
ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/0
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
R2#show run
Building configuration...
*Mar 3 11:47:12.553: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1196 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
!
!
!
!
interface Loopback0
ip address 10.1.2.1 255.255.255.0
!
interface Loopback1
ip address 202.2.2.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.1.12.2 255.255.255.0
shutdown
clock rate 64000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
ip address 10.1.23.2 255.255.255.0
clock rate 64000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 10.1.2.0 mask 255.255.255.0
network 202.2.2.0
neighbor 10.1.12.1 remote-as 100
neighbor 10.1.12.1 filter-list 1 out
neighbor 10.1.23.3 remote-as 300
neighbor 10.1.23.3 filter-list 1 out
no auto-summary
!
ip http server
ip classless
!
ip as-path access-list 1 permit ^$
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
R3#show run
Building configuration...
Current configuration : 1512 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
interface Loopback0
ip address 10.1.3.1 255.255.255.0
!
interface Loopback1
ip address 183.3.3.1 255.255.255.0
!
interface Loopback2
ip address 183.3.4.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.1.23.3 255.255.255.0
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router bgp 300
no synchronization
bgp log-neighbor-changes
network 10.1.3.0 mask 255.255.255.0
network 183.3.3.0 mask 255.255.255.0
network 183.3.4.0 mask 255.255.255.0
redistribute static route-map default
neighbor 10.1.23.2 remote-as 200
neighbor 10.1.23.2 route-map route out
no auto-summary
!
ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 Null0
!
!
!
ip prefix-list pref1 seq 5 permit 0.0.0.0/0
route-map default permit 10
match ip address prefix-list pref1
!
route-map route permit 10
match ip address prefix-list pref1
set as-path prepend 300 300
!
route-map route permit 20
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
09-04-2011 08:15 PM
Hi
because i do not have now a router to test it for you bellow are two methods to configure it in R3 and both aim to make R1 default route the preferred one
method one:
router bgp 300
redistribute static route-map default
neighbor 10.1.23.2 remote-as 200
neighbor 10.1.23.2 route-map route out
no auto-summary
!
ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 Null0
!
!
!
ip prefix-list pref1 seq 5 permit 0.0.0.0/0
route-map default permit 10
match ip address prefix-list pref1
!
route-map route permit 10
match ip address prefix-list pref1
set as-path prepend 300 300
!
route-map route permit 20
method 2:
router bgp 300
No redistribute static route-map default
neighbor 10.1.23.2 default-originate
neighbor 10.1.23.2 route-map route out
ip prefix-list pref1 seq 5 permit 0.0.0.0/0
route-map default permit 10
match ip address prefix-list pref1
!
route-map route permit 10
match ip address prefix-list pref1
set as-path prepend 300 300
!
route-map route permit 20
if dose not work post the following
from R2 show ip bgp when both links are up
and show ip bgp prefix-list pref1
and same when one of them is down
HTH
09-06-2011 07:50 AM
Hello,
I tried both options and when perfered interface is brough back up it does not replace the backup route in the routing table
R2#show ip bgp
BGP table version is 32, local router ID is 202.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 0.0.0.0 10.1.12.1 0 100 i
*> 10.1.23.3 0 300 i
*> 10.1.1.0/24 10.1.12.1 0 0 100 i
*> 10.1.2.0/24 0.0.0.0 0 32768 i
*> 10.1.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.4.0/24 10.1.23.3 0 0 300 i
*> 191.1.1.0/24 10.1.12.1 0 0 100 i
*> 191.1.2.0/24 10.1.12.1 0 0 100 i
*> 202.2.2.0 0.0.0.0 0 32768 i
R3#show ip prefix-list pref1
ip prefix-list pref1: 1 entries
seq 5 permit 0.0.0.0/0
R2#show ip bgp
BGP table version is 35, local router ID is 202.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.1.23.3 0 300 i
*> 10.1.2.0/24 0.0.0.0 0 32768 i
*> 10.1.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.3.0/24 10.1.23.3 0 0 300 i
*> 183.3.4.0/24 10.1.23.3 0 0 300 i
*> 202.2.2.0 0.0.0.0 0 32768 i
R2#
Thanks
09-06-2011 08:54 AM
The output indicates the as-path prepend was not applied to the prefix while leaving BGP AS 300.
I tried your configuration as posted and it worked. Did you clear ip bgp * out on R3 after applying the route-map?
You should have the default route with two AS 300 listed in the path.
09-08-2011 01:34 PM
Thank you for the help, I have it succesfully working now
09-08-2011 01:35 PM
Glad to be of help, please mark the thread as resolved.
09-08-2011 03:32 PM
This is good
Pls rate the helpful posts
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide