BGP/Examples/Example 1:One router with two peers

From ImageStream Router Documentation

< BGP | Examples
Revision as of 20:04, 10 September 2015 by Josh (Talk | contribs)
Jump to: navigation, search
This is meant to be an example, and not a complete BGP (Border Gateway Protocol) routing configuration.

Scenario

You have two connections to the internet. One connection through ISP 1, one connection through ISP 2. You need to advertise your network of 192.168.10.0/24 to both ISPs, and accept full feeds from both of them. The router has two ethernet interfaces, one connected to a LAN used by your servers, the other connected to a network used by your customers or employees.

Network Diagram

--------------------        -------------------------
|                  |        |                       |
| ISP 1            |        |   ISP 2               |
| AS  64513        |        |   AS  514             |
| IP  172.16.96.76 |        |   IP  10.200.10.3     |
|                  |        |                       |
--------------------        ------------------------
      |                          |
 EBGP |   +----------------------+    
      |   |      EBGP       
      |   |              
---------------------------------------------------------
      |   |     AS 64512
+--------------+               +-------------------+
| Main Router  |               | LAN               |
| 192.168.10.5 |---------------| 192.168.10.129/25 |
+--------------+  Ethernet 1   +-------------------+
      |                                 
      | Ethernet 0      
      |                
+-----------------+                      
| Servers         |
| 192.168.10.1/25 |          
+-----------------+          
Ensure that all routers running BGP have at least 512 MB of memory. Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup! To enable BGP, do the following:
  1. At the Login: prompt, enter root.
  2. At the Password: prompt, enter your password.
  3. Choose Option 1 (Configuration and Update Menu) from the Main Menu.
  4. Select Option 6 (Dynamic Routing Configuration).
  5. Select Option 2 (Quagga/Zebra)
  6. Select Option 2 (enable) and enable both Quagga/Zebra and bgpd.
  7. Go back up to the main Quagga/Zebra menu
  8. Select Option 4 (start) and start both Quagga/Zebra and bgpd.
BGP service is now enabled on boot and running.
In our example above, we will be configuring the "Main Router". From the Quagga/Zebra menu, choose Option 1 (Quagga configuration). Then select Option 4 (bgp configuration). This will connect to the Quagga command line, the default password is zebra. then type en to become administrator and type in the following configuration:
!
# This ASN is for testing and internal use *ONLY*
router bgp 64512
 bgp router-id 192.168.10.5
 bgp log-neighbor-changes
 network 192.168.10.0/24
 neighbor 172.16.96.76 remote-as 64513
 neighbor 172.16.96.76 soft-reconfiguration inbound
 neighbor 172.16.96.76 description ISP 1
 neighbor 172.16.96.76 route-map rm_peer_1_in in
 neighbor 172.16.96.76 route-map rm_peer_1_out out
 neighbor 10.200.10.3 remote-as 514
 neighbor 10.200.10.3 soft-reconfiguration inbound
 neighbor 10.200.10.3 description ISP 2
 neighbor 10.200.10.3 route-map rm_peer_2_in in
 neighbor 10.200.10.3 route-map rm_peer_2_out out
!
ip prefix-list pl_peer_1_out seq 5 permit 192.168.10.0/24
ip prefix-list pl_peer_2_out seq 5 permit 192.168.10.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
!

Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup!

Personal tools
Router software releases