02 July, 2013

BGP LOCAL PREFERENCE MED



BGP IBGP/EBGP LOCAL PREFERENCE MED


SCENARIO:

You are working for a company specialized in selling vegetables and fruit and responsible for the whole network. To reduce the risk of losing the connection to the Internet you decided to get another link to your ISP. The first link between Cherry and ISP is an expensive link where you have to pay for every megabyte that is transfered, this link should only be used for backup. The second link between Berry and ISP is cheap and up 24/7. All traffic should be sent using this link.

GOAL:

  • All IP addresses are preconfigured as specified in the topology picture.
  • Every router has a loopback interface:
    Kerry: Loopback0: 1.1.1.1 /24
    Cherry: Loopback0: 2.2.2.2 /24
    Berry: Loopback0: 3.3.3.3 /24
  • ISP: Loopback0: 4.4.4.4 /24
  • Configure EIGRP in AS 100.
  • Do not advertise the links between AS100 and AS200 in EIGRP.
  • Configure IBGP within AS100, the source of BGP updates has to be the loopback interface.
  • Configure EBGP between router Cherry and ISP.
  • Configure EBGP between router Berry and ISP.
  • Advertise the loopback interfaces into BGP, do this on all routers.
  • Ensure you have full reachability to all networks.
  • Do a traceroute from router ISP to the 1.1.1.0 network. Which path does it take? Do you know why this path was preferred over the other?
  • You need to make sure that all traffic for AS100 is being sent using the link between router Berry and ISP. You are only allowed to make changes on router Berry or Cherry. (hint: use MED)
  • To conform to the company policy, you need to make sure that all outgoing traffic will be sent using the link between router Berry and ISP. (hint: use Local Preference)
  • Optional: change the BGP setup between Cherry and ISP so the BGP updates are sourced from the loopback interfaces.(Its For You Write Here Your Configuration)
EIGRP Configuration
Berry#configure terminal
Berry(config)#router eigrp 100
Berry(config-router)#no auto
Berry(config-router)#network 192.168.13.3 0.0.0.0
Berry(config-router)#network 192.168.23.3 0.0.0.0
Berry(config-router)#network 3.3.3.3 0.0.0.0
Berry(config-router)#pass s0/0

Cherry#configure terminal
Cherry(config)#router eigrp 100
Cherry(config-router)#no auto
Cherry(config-router)#network 192.168.12.2 0.0.0.0
Cherry(config-router)#network 192.168.23.2 0.0.0.0

Cherry(config-router)#network 2.2.2.2 0.0.0.0
Cherry(config-router)#pass s0/0

Kerry#configure terminal
Kerry(config)#router eigrp 100
Kerry(config-router)#no auto
Kerry(config-router)#network 192.168.12.1 0.0.0.0
Kerry(config-router)#network 192.168.13.1 0.0.0.0
Kerry(config-router)#network 1.1.1.1 0.0.0.0

BGP Configuration

Kerry#configure terminal
Kerry(config)#router bgp 100
Kerry(config-router)#neighbor 2.2.2.2 remote-as 100
Kerry(config-router)#neighbor 3.3.3.3 remote-as 100
Kerry(config-router)#neighbor 2.2.2.2 update-source loopback 0
Kerry(config-router)#neighbor 3.3.3.3 update-source loopback 0
Kerry(config-router)#network 1.1.1.0 mask 255.255.255.0

Cherry#configure terminal
Cherry(config)#router bgp 100
Cherry(config-router)#neighbor 1.1.1.1 remote-as 100
Cherry(config-router)#neighbor 1.1.1.1 update-source loopback 0
Cherry(config-router)#neighbor 3.3.3.3 remote-as 100
Cherry(config-router)#neighbor 3.3.3.3 update-source loopback 0

Cherry(config-router)#neighbor 192.168.24.4 remote-as 200
Cherry(config-router)#network 2.2.2.0 mask 255.255.255.0
Cherry(config-router)#network 192.168.12.0 mask 255.255.255.0
Cherry(config-router)#network 192.168.23.0 mask 255.255.255.0
Cherry(config-router)#neighbor 1.1.1.1 next-hop-self

Berry#configure terminal
Berry(config)#router bgp 100
Berry(config-router)#neighbor 1.1.1.1 remote-as 100
Berry(config-router)#neighbor 1.1.1.1 update-source loopback 0
Berry(config-router)#neighbor 2.2.2.2 remote-as 100
Berry(config-router)#neighbor 2.2.2.2 update-source loopback 0
Berry(config-router)#neighbor 192.168.34.4 remote-as 200
Berry(config-router)#network 3.3.3.0 mask 255.255.255.0
Berry(config-router)#network 192.168.23.0 mask 255.255.255.0
Berry(config-router)#network 192.168.13.0 mask 255.255.255.0
Berry(config-router)#neighbor 1.1.1.1 next-hop-self

ISP#configure terminal
ISP(config)#router bgp 200
ISP(config-router)#neighbor 192.168.24.2 remote-as 100
ISP(config-router)#neighbor 192.168.34.3 remote-as 100
ISP(config-router)#network 4.4.4.0 mask 255.255.255.0

Verify All Connections

Kerry#ping 2.2.2.2
!!!!!
Kerry#ping 3.3.3.3
!!!!!
Kerry#ping 4.4.4.4
!!!!!

Configure MED
  • You need to make sure that all traffic for AS100 is being sent using the link between router Berry and ISP. You are only allowed to make changes on router Berry or Cherry. (hint: use MED)
ISP#show ip bgp
BGP table version is 28, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  1.1.1.0/24       192.168.24.2                           0 100 i
*>                  192.168.34.3                           0 100 i
*  2.2.2.0/24       192.168.24.2             0             0 100 i
<Lines Omitted>

Berry#conf terminal
Berry(config)#router bgp 100
Berry(config-router)#neighbor 192.168.34.4 route-map MED out
Berry(config)#route-map MED
Berry(config-route-map)#set metric 50


Cherry#conf terminal
Cherry(config)#router  bgp 100
Cherry(config-router)#neighbor 192.168.24.4 route-map MED out
Cherry(config-router)#exit
Cherry(config)#route-map MED
Cherry(config-route-map)#set metric 200

ISP#clear ip bgp *
ISP#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.0/24       192.168.34.3            50             0 100 i
*                   192.168.24.2           200             0 100 i
*> 2.2.2.0/24       192.168.34.3            50             0 100 i
*                   192.168.24.2           200             0 100 i
<Lines Omitted>

Configure Local Preference
  • To conform to the company policy, you need to make sure that all outgoing traffic will be sent using the link between router Berry and ISP. (hint: use Local Preference)
Kerry#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
<Lines Omitted>
* i4.4.4.0/24       3.3.3.3                  0    100      0 200 i
*>i                 2.2.2.2                  0    100      0 200 i
<Lines Omitted>

Berry#configure terminal
Berry(config)#route-map LOCALPREF
Berry(config-route-map)#set local-preference 444
Berry(config-route-map)#router bgp 100
Berry(config-router)#neighbor 192.168.34.4 route-map LOCALPREF in
Berry(config-router)#do clear ip bgp *

Kerry#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
<Lines Omitted>
*>i4.4.4.0/24       3.3.3.3                  0    444      0 200 i
* i                 2.2.2.2                  0    100      0 200 i
<Lines Omitted>

##########################################################################################################