The BGP conditional advertisement feature uses the non-exist-map and the advertise-map keywords of the neighbor advertise-map command in order to track routes by the route prefix. If a route prefix is not present in output of the non-exist-map command, then the route specified by the advertise-map command is announced. This feature is useful for multihomed networks, in which some prefixes are advertised to one of the providers only if information from the other provider is not present (this indicates a failure in the peering session or partial reachability).
! interface FastEthernet0/0 no ip address duplex auto speed auto ! ! â„–100, ComStar ! interface FastEthernet0/0.100 encapsulation dot1Q 100 ip address 10.192.0.10 255.255.255.0 ! ! â„–200 - QWERTY ! interface FastEthernet0/0.200 encapsulation dot1Q 200 ip address 192.168.1.10 255.255.255.0 ! ! ip forward-protocol nd ! ! - ( ), ! BGP . , - ! . ! ip route 88.88.10.0 255.255.254.0 Null0 ! ! BGP ! router bgp 11111 no synchronization ! router-id bgp router-id 10.192.0.10 no bgp enforce-first-as bgp log-neighbor-changes ! , network 88.88.10.0 mask 255.255.254.0 ! - - neighbor 10.192.0.200 remote-as 8359 neighbor 10.192.0.200 description ComStar neighbor 10.192.0.200 next-hop-self neighbor 10.192.0.200 soft-reconfiguration inbound ! () neighbor 10.192.0.200 weight 500 ! , neighbor 10.192.0.200 route-map comstar in ! , neighbor 10.192.0.200 route-map ournets out ! - neighbor 192.168.1.200 remote-as 8615 neighbor 192.168.1.200 description QWERTY neighbor 192.168.1.200 next-hop-self neighbor 192.168.1.200 soft-reconfiguration inbound ! ( ) neighbor 192.168.1.200 weight 100 neighbor 192.168.1.200 route-map qwerty in ! ! , ! , 88.88.10.0/23 ( ! non-exist-map neighbor 192.168.1.200 route-map ournets out ! , , 10.10.10.0/24 ! , . neighbor 192.168.1.200 advertise-map ournets non-exist-map NONEXIST_MAP no auto-summary ! ! , ip prefix-list NONEXIST seq 5 permit 10.10.10.0/24 ! ! "" , ! ip prefix-list bogons description Bad-nets ip prefix-list bogons seq 10 permit 127.0.0.0/8 le 32 ip prefix-list bogons seq 20 permit 172.16.0.0/12 le 32 ip prefix-list bogons seq 25 permit 192.168.0.0/16 le 32 ip prefix-list bogons seq 30 permit 169.254.0.0/16 le 32 ip prefix-list bogons seq 35 permit 224.0.0.0/4 le 32 ip prefix-list bogons seq 40 permit 240.0.0.0/4 le 32 ! ! , ip prefix-list our-network seq 5 permit 88.88.10.0/23 ip prefix-list our-network seq 10 deny 0.0.0.0/0 ! ! ! - ! QWERTY: ! "" route-map qwerty deny 100 match ip address prefix-list bogons ! , . , ! , route-map qwerty permit 110 set local-preference 200 ! ! route-map comstar deny 100 match ip address prefix-list bogons ! route-map comstar permit 110 set local-preference 100 ! ! NON-EXIST-MAP route-map NONEXIST_MAP permit 10 match ip address prefix-list NONEXIST ! ! route-map ournets permit 100 description Permit our prefixes match ip address prefix-list our-network
, - ( 10.10.10.0/24). , . . 10.10.10.0/24, 88.88.10.0/23 . bgp- , 10.10.10.0/24, advertise-map ournets non-exist-map NONEXIST_MAP - ( - , .
ip forward-protocol nd ! ip route 88.88.10.0 255.255.255.0 Null0 ip route 88.88.11.0 255.255.255.0 Null0 ! router bgp 11111 no synchronization bgp router-id 10.192.0.10 no bgp enforce-first-as bgp log-neighbor-changes ! /24 network 88.88.10.0 mask 255.255.255.0 network 88.88.11.0 mask 255.255.255.0 ! neighbor 10.192.0.200 remote-as 8359 neighbor 10.192.0.200 description ComStar neighbor 10.192.0.200 next-hop-self neighbor 10.192.0.200 soft-reconfiguration inbound ! neighbor 10.192.0.200 weight 500 ! neighbor 10.192.0.200 route-map comstar in ! (allournets - ) neighbor 10.192.0.200 route-map allournets out ! 20.20.20.0/24, - ! 88.88.11.0/24 neighbor 192.168.1.200 advertise-map ournets11 non-exist-map NONEXIST_MAP2 ! - neighbor 192.168.1.200 remote-as 8615 neighbor 192.168.1.200 description QWERTY neighbor 192.168.1.200 next-hop-self neighbor 192.168.1.200 soft-reconfiguration inbound neighbor 192.168.1.200 weight 100 neighbor 192.168.1.200 route-map qwerty in neighbor 192.168.1.200 route-map allournets out ! 10.10.10.0/24, - ! 88.88.10.0/24 neighbor 192.168.1.200 advertise-map ournets10 non-exist-map NONEXIST_MAP no auto-summary ! ! ., , ip prefix-list NONEXIST seq 5 permit 10.10.10.0/24 ! ! . ip prefix-list NONEXIST2 seq 5 permit 20.20.20.0/24 ! ip prefix-list bogons description Bad-nets ip prefix-list bogons seq 10 permit 127.0.0.0/8 le 32 ip prefix-list bogons seq 20 permit 172.16.0.0/12 le 32 ip prefix-list bogons seq 25 permit 192.168.0.0/16 le 32 ip prefix-list bogons seq 30 permit 169.254.0.0/16 le 32 ip prefix-list bogons seq 35 permit 224.0.0.0/4 le 32 ip prefix-list bogons seq 40 permit 240.0.0.0/4 le 32 ! ! ip prefix-list allour-network seq 5 permit 88.88.10.0/24 ip prefix-list allour-network seq 10 permit 88.88.11.0/24 ip prefix-list allour-network seq 15 deny 0.0.0.0/0 ! ! ( NON-EXIST-MAP) ! ip prefix-list our-network10 seq 5 permit 88.88.10.0/24 ip prefix-list our-network10 seq 10 deny 0.0.0.0/0 ! ! ( NON-EXIST-MAP) ! ip prefix-list our-network11 seq 5 permit 88.88.11.0/24 ip prefix-list our-network11 seq 10 deny 0.0.0.0/0 ! ! ! - route-map qwerty deny 100 match ip address prefix-list bogons ! route-map qwerty permit 110 set local-preference 200 ! ! NON-EXIST route-map NONEXIST_MAP permit 10 match ip address prefix-list NONEXIST ! route-map NONEXIST_MAP2 permit 10 match ip address prefix-list NONEXIST2 ! ! , . 1 2 route-map ournets10 permit 100 description Permit our prefixes match ip address prefix-list our-network10 ! route-map ournets11 permit 100 description Permit our prefixes match ip address prefix-list our-network11 ! ! route-map allournets permit 100 description Permit our prefixes match ip address prefix-list allour-network ! route-map comstar deny 100 match ip address prefix-list bogons ! route-map comstar permit 110 set local-preference 100
, - ( - .: - 10.10.10.0/24, - 20.20.20.0/24). 1. , 88.88.10.0/24 , 88.88.11.0/24 - . 2. , 10.10.10.0/24, "neighbor 192.168.1.200 advertise-map ournets10 non-exist-map NONEXIST_MAP", 88.88.10.0/24 . 3. , 20.20.20.0/24, "neighbor 10.192.0.200 advertise-map ournets11 non-exist-map NONEXIST_MAP2", 88.88.11.0/24 . - - .
Source: https://habr.com/ru/post/150969/
All Articles