! Single-router, PA-space, Basic Config
!
! Define your BGP ASN on your router
autonomous-system 900
!
! Define static NULL route to networks that
! will be announced to providers via BGP.
ip route 198.18.1.0 255.255.255.0 Null0 200
!
! Define ANNOUNCE prefix list, of your netblocks to announce
! via BGP to your providers. You will apply this prefix-
! list outbound on the BGP session to each provider.
ip prefix-list ANNOUNCE description Our External Netblocks
ip prefix-list ANNOUNCE seq 10 permit 198.18.1.0/24
!
! Define BOGONS prefix list, of bad netblocks you
! need to block from being accepting from your providers.
! Don’t just trust your provider to run a clean network!
! You will apply this prefix-list inbound on the BGP
! session to each provider.
ip prefix-list BOGONS description Bad Routes to Block In
ip prefix-list BOGONS seq 10 deny 0.0.0.0/8 le 32
ip prefix-list BOGONS seq 15 deny 10.0.0.0/8 le 32
ip prefix-list BOGONS seq 20 deny 127.0.0.0/8 le 32
ip prefix-list BOGONS seq 25 deny 172.16.0.0/12 le 32
ip prefix-list BOGONS seq 30 deny 192.0.2.0/24 le 32
ip prefix-list BOGONS seq 35 deny 192.168.0.0/16 le 32
ip prefix-list BOGONS seq 40 deny 224.0.0.0/3 le 32
! Prevent someone else from announcing your own prefix(es)
! back to you, for security: update this with YOUR
! actual announced block(s)!
ip prefix-list BOGONS seq 1000 deny 198.18.1.0/24 le 32
! Accept any other routes bigger or equal to /27. You
! can tweak this up to /24 if you like.
ip prefix-list BOGONS seq 9999 permit 0.0.0.0/0 le 27
!
!
router bgp 900
! don’t require your IGP to be in synch with BGP,
! synchronization has been outmoded for some time.
no synchronization
! tell your router to log changes to your BGP
! sessions, you’ll want to be concerned with BGP
! sessions when they go up and down, it’s just as
! important to your routing as a link up/down.
bgp log-neighbor-changes
! enable BGP dampening to minimize adverse impact
! of “flapping” routes (routes that are announced
! and withdrawn repeatedly).
bgp dampening
! define your BGP network statements: these are the
! aggregate external IP blocks you will be announcing
! to the Internet. Note that the network statement
! will not be effective unless there is an underlying
! route for the network, which is why we defined a
! static NULL route for this block above.
network 198.18.1.0 mask 255.255.255.0
Version 1.2 A How-To Guide to BGP Multihoming Lane Patterson
Feb 2004 Louis Lee
Page 10 of 10
! define our BGP session with ISP-1 (ASN 200)
!
neighbor 1.1.1.1 remote-as 200
! description allows you to put add a text label
neighbor 1.1.1.1 description BGP Transit to ISP-1
! hard-code version 4 to short-cut BGP version negotiation
neighbor 1.1.1.1 version 4
! send-community is nice if you will be setting communities
! on routes you announce to influence how your upstream
! provider re-announces the routes to the Internet. Many
! providers support sophisticated community sets to allow
! this kind of customer control.
neighbor 1.1.1.1 send-community
! Soft reconfiguration is nice, it prevents complete
! withdrawal and relearning of routes when doing “clear
! ip bgp” command. But it does require enough RAM to
! cache an extra copy of the table.
neighbor 1.1.1.1 soft-reconfiguration inbound
! Filter out bogus prefixes from your upstream. Don’t
! trust your ISP to do this for you.
neighbor 1.1.1.1 prefix-list BOGONS in
! Limit your announcement just to your public prefix(es).
! This enforces aggregation, and prevents you from
! announcing ASN 200’s routes to ASN 300, which would
! accidentally make yourself a transit between the two
! ISPs.
neighbor 1.1.1.1 prefix-list ANNOUNCE out
! enforce max-prefix limit: just in case your provider
! blows up their routing tables, this keeps your router
! from melting under the stress by shutting off the
! mis-behaving BGP session instead. Once your ISP fixes
! the problem, you can re-enable with a “clear ip bgp ...”
neighbor 1.1.1.1 maximum-prefix 140000
! define BGP session with ISP-2 (ASN 300)
neighbor 2.2.2.1 remote-as 300
neighbor 2.2.2.1 description BGP Transit to ISP-2
neighbor 2.2.2.1 version 4
neighbor 2.2.2.1 send-community
neighbor 2.2.2.1 soft-reconfiguration inbound
neighbor 2.2.2.1 prefix-list BOGONS in
neighbor 2.2.2.1 prefix-list ANNOUNCE out
neighbor 2.2.2.1 maximum-prefix 140000
!
end