Cisco Doc - Config BGP Loopback

Embed Size (px)

Citation preview

  • 8/11/2019 Cisco Doc - Config BGP Loopback

    1/6

    Cisco Doc: Config iBGP/eBGP with/without Loopback @

    Introduction on BGP

    Exterior Gateway protocol (EGP)perform inter-domain routing in TCP/IP network

    Establish TCP connectivity (TCP port # 179)with other BGP router peer in order to exchange BGP updates

    eBGP session2 BGP router peers have different AS #

    iBGP session2 BGP router peers have same AS#

    Default Peer relationship is established using IP@ of the interface closest to the peer.

    Any operational interface (inc loopback int) can establish peer relationship using neigbour update-source

    command.

    iBGP Configuration without Loopback

    iBGP Configuration with Loopback

    Router R1-AGS

    interface Serial1

    ip address 10.10.10.1 255.255.255.0

    !

    router bgp 400

    neighbor 10.10.10.2 remote-as 400

    end

    Router R6-2500

    interface Serial0

    ip address 10.10.10.2 255.255.255.0

    !

    router bgp 400

    neighbor 10.10.10.1 remote-as 400

    end

    Both routers have same AS#: AS 400

    R1-AGS S1 int IP@: 10.10.10.1/24

    R6-2500 S0 int IP@: 10.10.10.2/24

    Router R1-AGSinterface Serial1

    ip address 10.10.10.1 255.255.255.0

    !

    Interface loopback1

    Ip address 1.1.1.1 255.255.255.255

    !

    router bgp 400

    neighbour 2.2.2.2 remote-as 400

    neighbour 2.2.2.2 update-source loopback2

    !

    Ip route 2.2.2.2 255.255.255.255 10.10.10.2

    end

    Router R6-2500

    interface Serial0

    ip address 10.10.10.2 255.255.255.0

    !

    Int loopback2

    Ip address 2.2.2.2 255.255.255.255

    !

    router bgp 400

    neighbour 1.1.1.1 remote-as 400

    neighbour 1.1.1.1 update-source loopback1

    !

    Ip route 1.1.1.1 255.255.255.255 10.10.10.1

    end

  • 8/11/2019 Cisco Doc - Config BGP Loopback

    2/6

    eBGP Configuration without Loopback (Different AS#)

    eBGP Configuration with Loopback Interface

    Router R1-AGS

    interface Serial1

    ip address 10.10.10.1 255.255.255.0

    !

    router bgp 300

    neighbor 10.10.10.2 remote-as 400

    end

    Router R6-2500

    interface Serial0

    ip address 10.10.10.2 255.255.255.0

    !

    router bgp 400

    neighbor 10.10.10.1 remote-as 300

    end

    AS 300AS 400

    Router R1-AGS

    interface Serial1

    ip address 10.10.10.1 255.255.255.0

    !

    Int loopback1

    Ip address 1.1.1.1. 255.255.255.255

    !

    router bgp 300

    neighbour 2.2.2.2 remote-as 400

    neighbour 2.2.2.2 ebgp-multihop 2!--- This command changes the ttl value in!--- order to allow the packet to reach the

    !--- external BGP peer which is not directly

    !--- connected or is using an interface other

    !--- than the directly connected interface.

    neighbour 2.2.2.2 update-source loopback2

    !

    Ip route 2.2.2.2 255.255.255.255 10.10.10.2

    end

    Router R6-2500

    interface Serial0ip address 10.10.10.2 255.255.255.0

    !

    Int loopback2

    Ip address 2.2.2.2 255.255.255.255

    !

    router bgp 400

    neighbour 1.1.1.1 remote-as 300

    neighbour 1.1.1.1 ebgp-multihop 2

    neighbour 1.1.1.1 update-source loopback1

    !

    End

    Ip route 1.1.1.1 255.255.255.255 10.10.10.1

  • 8/11/2019 Cisco Doc - Config BGP Loopback

    3/6

    Verify BGP connection with peers: show ip bgp neighbours/summary

    Verify iBGP:Without Loopback:R1-AGS# show ip bgp neighbors | include BGP

    BGP neighbor is 10.10.10.2, remote AS 400, internal link

    BGP version 4, remote router ID 2.2.2.2

    BGP state = Established, up for 00:04:20

    BGP table version 1, neighbor version 1

    R1-AGS#

    R1-AGS(9)# show ip bgp summary

    BGP router identifier 10.1.1.2, local AS number 400

    BGP table version is 1, main routing table version 1

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

    10.10.10.2 4 400 3 3 1 0 0 00:00:26 0

    With Loopback:R1-AGS# show ip bgp neighbors | include BGP

    BGP neighbor is2.2.2.2, remote AS 300, internal link

    BGP version 4, remote router ID 2.2.2.2

    BGP state = Established, up for 00:00:28

    BGP table version 1, neighbor version 1

    R1-AGS#

    R1-AGS(9)# show ip bgp summary

    BGP table version is 1, main routing table version 1

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

    2.2.2.2 4 400 3 3 1 0 0 00:00:26 0

    Verify BGP:Without Loopback:R1-AGS# show ip bgp neighbors | include BGP

    BGP neighbor is 10.10.10.2, remote AS 400, external link

    BGP version 4, remote router ID 2.2.2.2

    BGP state = Established, up for 00:00:17

    BGP table version 1, neighbor version 1

    R1-AGS(9)# show ip bgp summary

    BGP router identifier 10.10.10.1, local AS number 300

    BGP table version is 1, main routing table version 1

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

    10.10.10.2 4 400 3 3 1 0 0 00:00:26 0

    With Loopback:R1-AGS# show ip bgp neighbors | include BGP

    BGP neighbor is 2.2.2.2, remote AS 400, external link

    BGP version 4, remote router ID 2.2.2.2

    BGP state = Established, up for 00:00:16

    BGP table version 1, neighbor version 1

    External BGP neighbor may be up to 2 hops away.

    R1-AGS(9)# show ip bgp summary

    BGP router identifier 1.1.1.1, local AS number 300

    BGP table version is 1, main routing table version 1

    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

    2.2.2.2 4 400 3 3 1 0 0 00:00:26 0

  • 8/11/2019 Cisco Doc - Config BGP Loopback

    4/6

    Cisco DocumentBGP Best Path Selection Algorithm

    The algorithm is used to decide best routing path to the destination and avoid route redundancy.

    Why Router ignore the path:

    Path is not sync.

    Path for which the NEXT_HOP is inaccessible

    Path from the eBGP peer where the local AS# appears in the AS_PATH

    The update that does not contain the NB AS# as the 1stAS# in the AS_SEQ Path that mark as receive-only (show ip bgp route)

    How the Best Path Algorithm works?

    Prefer the path that has higher WEIGHT/LOCAL_PREF

    Prefer the path with shortest AS_PATH

    Prefer the path with lowest Origin type (IGP

  • 8/11/2019 Cisco Doc - Config BGP Loopback

    5/6

    Load-Balancing in Cisco

    2 types: PerDestination and Per-Packet Load Balancing

    Per-destination: The router distributes the packets based on the destination address. All packets for Dest_1 1st

    path,

    all packets for Dest_2 go over 2nd

    path. Router need to build a route-cache entry for every destination address,

    instead of every destination network, as is the case when only a single path exists. Therefore traffic for different

    hosts on the same destination network use different paths.

    Advantage: Preserves packet order.

    Disadvantage: May cause unequal usage of the links. If one host receives the majority of the traffic all packets useone link, which leaves bandwidth on other links unused. Core backbone routers consume large computer resource to

    perform the load balancing (Maintain the cache to route traffic to destination hosts.)

    Per-packet load-balancing: The router distributes the packet towards 1 destination hosts to several links equally.

    Advantage: Guarantees equal load across all links.

    Disadvantage: Packets may arrive out of order at the destination because differential delay may exist within the

    network. Extensive processing load is created at router to look for less utilized interface packet forwarding from

    route table. Not suitable for high speed interface/transmission as delay created from the mechanism

    aforementioned.

    **For IOS, per packet load balancing will disable the forwarding acceleration by a route cache. This is because theroute cache information includes the outgoing interface. In order for per-packet load balancing to achieve equal link

    utilizations, the forwarding process determines the outgoing interface for each packet by looking up the route table

    and picking the least used interface. but is a processor intensive task and impacts the overall forwarding

    performance. This form of per-packet load balancing is not well suited for higher speed interfaces.

    By default, most Cisco routers are configured with fast switching enabled under interfaces. This is a demand caching

    scheme that does per-destination load-balancing.

    To set per-packet load-balancing, enable process switching by disable fast switching:

    Router# config t

    Router(config)# interface Ethernet 0

    Router(config-if)# no ip route-cacheRouter(config-if)# Z

    Now the router CPU looks at every single packet and load balances on the number of routes in the routing table for

    the destination. This can crash a low-end router because the CPU must do all the processing . To re-enable fast

    switching, use these commands:

    Router# config t

    Router(config)# interface Ethernet 0

    Router(config-if)# ip route-cache

    Router(config-if)# Z

    CEF: Cisco Express Forwardingdoes Load-balancing faster

    http://www.cisco.com/en/US/products/hw/modules/ps2033/prod_technical_reference09186a00800afeb7.html

    http://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/18285-loadbal-cef.html

    Load Balancing

    http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.html

    http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-

    load-balancing.pdf

    http://www.cisco.com/en/US/products/hw/modules/ps2033/prod_technical_reference09186a00800afeb7.htmlhttp://www.cisco.com/en/US/products/hw/modules/ps2033/prod_technical_reference09186a00800afeb7.htmlhttp://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/18285-loadbal-cef.htmlhttp://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/18285-loadbal-cef.htmlhttp://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.htmlhttp://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.htmlhttp://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-load-balancing.pdfhttp://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-load-balancing.pdfhttp://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-load-balancing.pdfhttp://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-load-balancing.pdfhttp://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipswitch_cef/configuration/xe-3s/isw-cef-xe-3s-book/isw-cef-load-balancing.pdfhttp://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.htmlhttp://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/18285-loadbal-cef.htmlhttp://www.cisco.com/en/US/products/hw/modules/ps2033/prod_technical_reference09186a00800afeb7.html
  • 8/11/2019 Cisco Doc - Config BGP Loopback

    6/6