This example is based on a fictional network with:
router bgp 12345 | This starts my BGP config block. |
no synchronization | Do not tie my BGP announcements to OSPF, RIP, or other routing protocol. |
redistribute static | Announce my static routes |
network 223.100.32.0 mask 255.255.224.0 | Announce my /19 network block |
network 223.200.8.0 mask 255.255.248.0 | Announce my /21 network block |
aggregate-address 223.100.32.0 255.255.224.0 | Announce my /19 block as a single entity |
aggregate-address 223.200.8.0 255.255.224.0 | Announce my /21 block as a single entity |
neighbor 160.123.123.1 remote-as 1234 | My first BGP peer is AS 1234 |
neighbor 160.123.123.1 distribute-list 1 in | See access-list 1 for description. |
neighbor 160.123.123.1 filter-list 10 out | Only announce my own routes |
neighbor 206.150.180.5 remote-as 5678 | My second BGP peer is AS 5678 |
neighbor 206.150.180.5 distribute-list 1 in | See access-list 1 for description. |
neighbor 206.150.180.5 filter-list 10 out | Only announce my own routes |
no auto-summary | Do not combine small routes into larger ones. |
ip as-path access-list 10 permit ^$ | Only announce routes that I originate. |
access-list 1 deny 223.100.32.0 0.0.31.255 access-list 1 deny 223.200.8.0 0.0.7.255 access-list 1 permit any |
If my BGP peer sends me one of my own routes, discard it. |
ip route 223.100.32.0 255.255.224.0 null0 | Even if one (or more) blocks in my /19 do not have a route, continue routing the whole /19 |
ip route 223.200.8.0 255.255.248.0 null0 | Always advertise the full /21 |