Basic BGP config generator

This tool is beta. As such it still requires work, please review any configs generated by this tool for correctness. Contact technical support with any problems. This was modified on Tuesday Sep 7 at 10PM, specifially I added some blocks to prevent accepting routes to rfc1918 addresses. It meets the basic sanity check, but may be incorrect.

Local information

Your AS Number (Assigned by ARIN, normally between 1 and 64511):
Your router id (an IP address located on the router):
Netblock(s) you want to advertise (Assigned by ARIN or your ISP):

Peer 1

Name of ISP for peer 1:
AS Number for peer 1 (Collected from the ISP):
IP address for peer 1 (Collected from the ISP):
How many hops away is the peer:

Peer 2

Name of ISP for peer 2:
AS Number for peer 2 (Collected from the ISP):
IP address for peer 2 (Collected from the ISP):
How many hops away is the peer:

!
# This ASN is for testing and internal use *ONLY*
router bgp 64512
bgp router-id 10.10.199.199
bgp log-neighbor-changes
network 10.10.199.0/24

# Begin configuration for Peer 1
neighbor 192.168.1.2 remote-as 64513
neighbor 192.168.1.2 soft-reconfiguration inbound
neighbor 192.168.1.2 description Peer 1
neighbor 192.168.1.2 route-map rm_peer_1_in in
neighbor 192.168.1.2 route-map rm_peer_1_out out

# Begin configuration for Peer 2
neighbor 192.168.2.2 remote-as 64514
neighbor 192.168.2.2 soft-reconfiguration inbound
neighbor 192.168.2.2 description Peer 2
neighbor 192.168.2.2 route-map rm_peer_2_in in
neighbor 192.168.2.2 route-map rm_peer_2_out out
!

# First we deny unwanted networks
ip prefix-list pl_peer_1_in seq 5 deny 10.0.0.0/8
ip prefix-list pl_peer_1_in seq 10 deny 172.16.0.0/12
ip prefix-list pl_peer_1_in seq 15 deny 192.168.0.0/16
ip prefix-list pl_peer_1_in seq 20 deny 169.254.0.0/16
ip prefix-list pl_peer_1_in seq 25 deny 0.0.0.0/8
ip prefix-list pl_peer_1_in seq 30 deny 127.0.0.0/8
ip prefix-list pl_peer_1_in seq 35 deny 198.18.0.0/15
ip prefix-list pl_peer_1_in seq 40 deny 192.0.2.0/24
ip prefix-list pl_peer_1_in seq 45 deny 198.51.100.0/24
ip prefix-list pl_peer_1_in seq 50 deny 203.0.113.0/24
# Then we allow everything else
ip prefix-list pl_peer_1_in seq 55 permit any
ip prefix-list pl_peer_1_out seq 5 permit 10.10.199.0/24

# First we deny unwanted networks
ip prefix-list pl_peer_2_in seq 5 deny 10.0.0.0/8
ip prefix-list pl_peer_2_in seq 10 deny 172.16.0.0/12
ip prefix-list pl_peer_2_in seq 15 deny 192.168.0.0/16
ip prefix-list pl_peer_2_in seq 20 deny 169.254.0.0/16
ip prefix-list pl_peer_2_in seq 25 deny 0.0.0.0/8
ip prefix-list pl_peer_2_in seq 30 deny 127.0.0.0/8
ip prefix-list pl_peer_2_in seq 35 deny 198.18.0.0/15
ip prefix-list pl_peer_2_in seq 40 deny 192.0.2.0/24
ip prefix-list pl_peer_2_in seq 45 deny 198.51.100.0/24
ip prefix-list pl_peer_2_in seq 50 deny 203.0.113.0/24
# Then we allow everything else
ip prefix-list pl_peer_2_in seq 55 permit any
ip prefix-list pl_peer_2_out seq 5 permit 10.10.199.0/24
!
route-map rm_peer_1_out permit 5
match ip address prefix-list pl_peer_1_out
set as-path prepend 64512
!
route-map rm_peer_1_in permit 5
# Adjust this to favor some peers over others.
# Higher number is more preferred
# 0 - 255 with 100 being the default
set local-preference 100
!
route-map rm_peer_2_out permit 5
match ip address prefix-list pl_peer_2_out
set as-path prepend 64512
!
route-map rm_peer_2_in permit 5
# Adjust this to favor some peers over others.
# Higher number is more preferred
# 0 - 255 with 100 being the default
set local-preference 100
!

3 Responses to “Basic BGP config generator”

  1. Manickam says:

    Hi,

    Thanks for the information its very useful, please let me what hardware configuration is required for two ISP multihome for full routing table

    I have Cisco 2811 with 512MB of Memory kindly advice,

    Thanks
    Manickam

  2. :-> I obtained a hyperlink to this posting from Themelis Cuiper’s SocialGarden Business cases of socialmedia advertising & socialmedia marketing – you are doing a cool job as he provides a link to you!

Leave a Reply

WordPress Themes