TASK 7 & 9
If net 2.0.0.0 is up and it’s advertised to R1, R1 should take the
following actions:
-r1 should NOT advertise it’s network 1.0.0.0/8 to R3
-r1 should oNLY advertise network 2.0.0.0/8 to R3
However is net 2.0.0.0/8 is down then R1 should take the following
actions:
-R1 should advertise network 1.0.0.0/8 to R3
-R1 should remove network 2.0.0.0/8 from it’s BGP table.
to conditionally advertise we can use the following
commands:
advertise-map
non-exist-map
exist-map.
r1
access-list 1 permit 1.0.0.0 0.255.255.255
access-list 2 permit 2.0.0.0 0.255.255.255
route-map ADV per 10
match ip add 1
route-map NotThere per 10
match ip add 2
router bgp 100
neighbor 10.1.13.3 advertise-map ADV non-exist-map NotThere
advertise-map map-name
Specifies the name of the route map that will be advertised if the conditions of the exist map or nonexist map are met.
exist-map map-name
Specifies the name of the route map that will be compared to the advertise map. If the condition is met and a match occurs between the advertise map and exist map, the route will be advertised. If no match occurs, then the condition is not met, and the route iswithdrawn.
non-exist-map map-name
Specifies the name of the route map that will be compared to the advertise map. If the condition is met and no match occurs, the route will be advertised. If a match occurs, then the condition is not met, and the route is withdrawn.
note: the advertise-map specifies the name of the route-map that will be advertised if the condition of the non-exsit-map is met.
neighbor 10.1.13.3 advertise-map ADV(match 1.0.0.0) non-exist-map
NotThere (match 2.0.0.0)
so bgp will advertise 1.0.0.0 if 2.0.0.0 is not there. But if the 2.0.0.0 is there then it will not advertise the 1.0.0.0 prefix.
note: the non-exist-map specifies the route-map that will be compared to the advertise-map. If the condition is met then the route will be advertised. If a match occurs then the condition is NOT met and the route will be withdrawn.
neighbor 10.1.13.3 advertise-map ADV(match 1.0.0.0) non-exist-map
NotThere (match 2.0.0.0)
so because 2.0.0.0 is there when the non-exist-map looks to match the
2.0.0.0 prefix then the 1.0.0.0 prefix is not advertised
sho ip bgp nei 10.1.13.3 advertised-routes
————————————————————-
1- if both 1.0.0.0 & 2.0.0.0 are up then both networks should be
advertised to R3.
2-if net 1.0.0.0 is down, R1 should NOT advertise net 2.0.0.0 to R3
3-if net 2.0.0.0 is down, then R1 should only advertise 1.0.0.0 to R3
access-list 1 per 1.0.0.0 0.255.255.255
access-list 2 per 2.0.0.0 0.255.255.255
route-map ADV per 10
match ip add 2.0.0.0
route-map EXIST per 10
match ip add 1.0.0.0
router bgp 100
neig 10.1.13.3 advertise-map ADV (2.0.0.0) exist-map EXIST (1.0.0.0)
so if the exist-map matches the prefix’s in EXIST (1.0.0.0) and in the advertise-map ADV (2.0.0.0) then the prefix is advertised.
to test condition #1
sh ip bgp nei 10.1.13.3 advertised-routes
BGP table version is 20, local router ID is 1.1.1.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
*> 1.0.0.0 0.0.0.0 0 32768 i
*> 2.0.0.0 10.1.12.2 0 0 200 i
note: since EXIST and ADV both match the prefix’s in the bgp table both networks are advertised. So since 1.0.0.0 exists both 1.0.0.0
and 2.0.0.0 will be advertised. to test conditon #2 – so if 1.0.0.0 is down it should not advertise 2.0.0.0
r1
int lo0
shut
sh ip bgp nei 10.1.13.3 advertised-routes
Total number of prefixes 0
note:since the exist-map did not match EXIST (because 1.0.0.0 is down and hte prefix is not in the bgp table) the EXIST prefix and ADV prefix is not advertised.
to test condition #3 – if 2.0.0.0 is down it should advertise 1.0.0.0
sho ip bgp nei 10.1.13.3 adver
BGP table version is 21, local router ID is 1.1.1.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
*> 1.0.0.0 0.0.0.0 0 32768 i
Total number of prefixes 1
note: since the advertise-map (2.0.0.0 is down) did not match ADV 2.0.0.0 was not advertised.
————————————————
neig 10.1.13.3 advertise-map ADV (2.0.0.0) exist-map EXIST (1.0.0.0)
if 1.0.0.0 prefix esists advertsise both 1.0.0.0 & 2.0.0.0.
if 1.0.0.0 does not exist do not advertise anything.
if 1.0.0.0 exists but 2.0.0.0 does not exist advertise 1.0.0.0.
neighbor 10.1.13.3 advertise-map ADV(match 1.0.0.0) non-exist-map
NotThere (match 2.0.0.0)
if 2.0.0.0 does not exist advertise 1.0.0.0
if 2.0.0.0 does exist 2.0.0.0 will be advertised and ADV 1.0.0.0
will not be advertised. The point of a non-exist-map is that there should be no match and if there is a match then the advertise-map is not advertised even if the prefix is in the bgp table. so bgp will advertise 1.0.0.0 if 2.0.0.0 is not there. But if the 2.0.0.0 is there then it will not advertise the 1.0.0.0 prefix
clear ip bgp * for the changes to take effect.
This is pretty easy if you don’t get confused by the question. Using route-map names that make sense also help tremendously