Вы находитесь на странице: 1из 3

BGP/Examples/Example 2:Two routers with two peers - ImageStream Ro...

http://wiki.imagestream.com/wiki/BGP/Examples/Example_2:Two_route...

BGP/Examples/Example 2:Two routers with two peers


From ImageStream Router Documentation
< BGP | Examples This is meant to be an example, and not a complete BGP (Border Gateway Protocol) routing configuration.

Contents
1 Scenario 2 Network Diagram 3 Configuration 3.1 Router 1 3.1.1 wan.conf 3.1.2 BGP configuration 3.2 Router 2 3.2.1 wan.conf 3.2.2 BGP configuration

Scenario
You have two connections to the internet. One connection through ISP 1, one connection through ISP 2. Each ISP has a router connected to it. Each router has two ethernet ports, Ethernet port 0 is connected to the other router, while ethernet port 1 is connected to your LAN. You want to advertise your network of 192.168.42.0/24 to both ISPs. Furthermore, you want to ensure that traffic always has a path in and out of your network.

Network Diagram
+-------------------------+ +----------------------+ | | | | | ISP 1 | | ISP 2 | | AS 932 | | AS 8855 | | | | | +-------------------------+ +----------------------+ | 12.23.4.1/30 | 120.2.4.1/30 | | | EBGP | EBGP | | --------------------------------------------------------| AS 9009 | | 12.23.4.2/30 | 120.2.4.2/30 +----------------+ +---------------+ | Router 1 | 192.168.40.1/30 | Router 2 | | |-----------------------| | +----------------+ 192.168.40.2/30+---------------+

1 of 3

16/01/2013 12:29

BGP/Examples/Example 2:Two routers with two peers - ImageStream Ro...

http://wiki.imagestream.com/wiki/BGP/Examples/Example_2:Two_route...

| 192.168.42.2/24 | | ---------[ LAN Switch

| 192.168.42.3/24 | | ]--------

Ensure that all routers running BGP have at least 512MB of memory. Remember to save your configurations to flash whenever you are finished configuring your dynamic routing setup!

Configuration
There is more to this configuration than only BGP. First, the routers connect together via Ethernet0. Static routes must be assigned to each router so that either router knows to find its other half. Router 1
wan.conf

! interface Serial0 ip address 12.23.4.2 255.255.255.252 ! interface Ethernet0 ip address 192.168.40.1 255.255.255.252 ! interface Ethernet1 ip address 192.168.42.2 255.255.255.0 ! ip route add default via 12.23.4.1

BGP configuration

! router bgp 9009 bgp router-id 12.23.4.2 bgp log-neighbor-changes network 192.168.42.0/24 # Begin configuration for ISP 1 neighbor 12.23.4.1 remote-as 932 neighbor 12.23.4.1 soft-reconfiguration inbound neighbor 12.23.4.1 description ISP 1 neighbor 12.23.4.1 route-map rm_peer_1_in in neighbor 12.23.4.1 route-map rm_peer_1_out out # Begin configuration neighbor 192.168.40.2 neighbor 192.168.40.2 neighbor 192.168.40.2 neighbor 192.168.40.2 for Router 2 remote-as 9009 soft-reconfiguration inbound description Router 2 next-hop-self

! ip prefix-list pl_peer_1_out seq 5 permit 192.168.42.0/24 ! route-map rm_peer_1_out permit 5 match ip address prefix-list pl_peer_1_out ! 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 !

Router 2

2 of 3

16/01/2013 12:29

BGP/Examples/Example 2:Two routers with two peers - ImageStream Ro...

http://wiki.imagestream.com/wiki/BGP/Examples/Example_2:Two_route...

wan.conf

! interface Serial0 ip address 120.2.4.2 255.255.255.252 ! interface Ethernet0 ip address 192.168.40.2 255.255.255.252 ! interface Ethernet1 ip address 192.168.42.3 255.255.255.0 ! ip route add default via 120.2.4.1

BGP configuration

! router bgp 9009 bgp router-id 120.2.4.2 bgp log-neighbor-changes network 192.168.42.0/24 # Begin configuration for ISP 2 neighbor 120.2.4.1 remote-as 8855 neighbor 120.2.4.1 soft-reconfiguration inbound neighbor 120.2.4.1 description ISP 2 neighbor 120.2.4.1 route-map rm_peer_1_in in neighbor 120.2.4.1 route-map rm_peer_1_out out # Begin configuration neighbor 192.168.40.1 neighbor 192.168.40.1 neighbor 192.168.40.1 neighbor 192.168.40.1 for Router 2 remote-as 9009 soft-reconfiguration inbound description Router 1 next-hop-self

! ip prefix-list pl_peer_1_out seq 5 permit 192.168.42.0/24 ! route-map rm_peer_1_out permit 5 match ip address prefix-list pl_peer_1_out ! 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 !

Retrieved from "http://wiki.imagestream.com/wiki/BGP/Examples/Example_2:Two_routers_with_two_peers" This page was last modified on 20 August 2012, at 16:47.

3 of 3

16/01/2013 12:29

Вам также может понравиться