BGP confederation configuration example
Network requirements
As shown in Figure 69, split AS 200 into three sub-ASs (AS 65001, AS 65002, and AS 65003) to reduce IBGP connections. Switches in AS65001 are fully meshed.
Figure 69: Network diagram
Table 15: Interface and IP address assignment
Device | Interface | IP address | Device | Interface | IP address |
---|---|---|---|---|---|
Switch A | Vlan-int100 | 200.1.1.1/24 | Switch D | Vlan-int200 | 10.1.5.1/24 |
Vlan-int200 | 10.1.1.1/24 | Vlan-int400 | 10.1.3.2/24 | ||
Vlan-int300 | 10.1.2.1/24 | Switch E | Vlan-int200 | 10.1.5.2/24 | |
Vlan-int400 | 10.1.3.1/24 | Vlan-int500 | 10.1.4.2/24 | ||
Vlan-int500 | 10.1.4.1/24 | Switch F | Vlan-int100 | 200.1.1.2/24 | |
Switch B | Vlan-int200 | 10.1.1.2/24 | Vlan-int600 | 9.1.1.1/24 | |
Switch C | Vlan-int300 | 10.1.2.2/24 |
Configuration procedure
Configure IP addresses for interfaces. (Details not shown.)
Configure BGP confederation:
# Configure Switch A.
<SwitchA> system-view [SwitchA] bgp 65001 [SwitchA-bgp] router-id 1.1.1.1 [SwitchA-bgp] confederation id 200 [SwitchA-bgp] confederation peer-as 65002 65003 [SwitchA-bgp] peer 10.1.1.2 as-number 65002 [SwitchA-bgp] peer 10.1.2.2 as-number 65003 [SwitchA-bgp] address-family ipv4 unicast [SwitchA-bgp-ipv4] peer 10.1.1.2 enable [SwitchA-bgp-ipv4] peer 10.1.2.2 enable [SwitchA-bgp-ipv4] peer 10.1.1.2 next-hop-local [SwitchA-bgp-ipv4] peer 10.1.2.2 next-hop-local [SwitchA-bgp-ipv4] quit [SwitchA-bgp] quit
# Configure Switch B.
<SwitchB> system-view [SwitchB] bgp 65002 [SwitchB-bgp] router-id 2.2.2.2 [SwitchB-bgp] confederation id 200 [SwitchB-bgp] confederation peer-as 65001 65003 [SwitchB-bgp] peer 10.1.1.1 as-number 65001 [SwitchB-bgp] address-family ipv4 unicast [SwitchB-bgp-ipv4] peer 10.1.1.1 enable [SwitchB-bgp-ipv4] quit [SwitchB-bgp] quit
# Configure Switch C.
<SwitchC> system-view [SwitchC] bgp 65003 [SwitchC-bgp] router-id 3.3.3.3 [SwitchC-bgp] confederation id 200 [SwitchC-bgp] confederation peer-as 65001 65002 [SwitchC-bgp] peer 10.1.2.1 as-number 65001 [SwitchC-bgp] address-family ipv4 unicast [SwitchC-bgp-ipv4] peer 10.1.2.1 enable [SwitchC-bgp-ipv4] quit [SwitchC-bgp] quit
Configure IBGP connections in AS 65001:
# Configure Switch A.
[SwitchA] bgp 65001 [SwitchA-bgp] peer 10.1.3.2 as-number 65001 [SwitchA-bgp] peer 10.1.4.2 as-number 65001 [SwitchA-bgp] address-family ipv4 unicast [SwitchA-bgp-ipv4] peer 10.1.3.2 enable [SwitchA-bgp-ipv4] peer 10.1.4.2 enable [SwitchA-bgp-ipv4] peer 10.1.3.2 next-hop-local [SwitchA-bgp-ipv4] peer 10.1.4.2 next-hop-local [SwitchA-bgp-ipv4] quit [SwitchA-bgp] quit
# Configure Switch D.
<SwitchD> system-view [SwitchD] bgp 65001 [SwitchD-bgp] router-id 4.4.4.4 [SwitchD-bgp] confederation id 200 [SwitchD-bgp] peer 10.1.3.1 as-number 65001 [SwitchD-bgp] peer 10.1.5.2 as-number 65001 [SwitchD-bgp] address-family ipv4 unicast [SwitchD-bgp-ipv4] peer 10.1.3.1 enable [SwitchD-bgp-ipv4] peer 10.1.5.2 enable [SwitchD-bgp-ipv4] quit [SwitchD-bgp] quit
# Configure Switch E.
<SwitchE> system-view [SwitchE] bgp 65001 [SwitchE-bgp] router-id 5.5.5.5 [SwitchE-bgp] confederation id 200 [SwitchE-bgp] peer 10.1.4.1 as-number 65001 [SwitchE-bgp] peer 10.1.5.1 as-number 65001 [SwitchE-bgp] address-family ipv4 unicast [SwitchE-bgp-ipv4] peer 10.1.4.1 enable [SwitchE-bgp-ipv4] peer 10.1.5.1 enable [SwitchE-bgp-ipv4] quit [SwitchE-bgp] quit
Configure the EBGP connection between AS 100 and AS 200:
# Configure Switch A.
[SwitchA] bgp 65001 [SwitchA-bgp] peer 200.1.1.2 as-number 100 [SwitchA-bgp] address-family ipv4 unicast [SwitchA-bgp-ipv4] peer 200.1.1.2 enable [SwitchA-bgp-ipv4] quit [SwitchA-bgp] quit
# Configure Switch F.
<SwitchF> system-view [SwitchF] bgp 100 [SwitchF-bgp] router-id 6.6.6.6 [SwitchF-bgp] peer 200.1.1.1 as-number 200 [SwitchF-bgp] address-family ipv4 unicast [SwitchF-bgp-ipv4] peer 200.1.1.1 enable [SwitchF-bgp-ipv4] network 9.1.1.0 255.255.255.0 [SwitchF-bgp-ipv4] quit [SwitchF-bgp] quit
Verifying the configuration
# Display the routing table on Switch B.
[SwitchB] display bgp routing-table ipv4 Total number of routes: 1 BGP local router ID is 2.2.2.2 Status codes: * - valid, > - best, d - dampened, h - history, s - suppressed, S - stale, i - internal, e - external Origin: i - IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn * >i 9.1.1.0/24 10.1.1.1 0 100 0 (65001) 100i [SwitchB] display bgp routing-table ipv4 9.1.1.0 BGP local router ID: 2.2.2.2 Local AS number: 65002 Paths: 1 available, 1 best BGP routing table information of 9.1.1.0/24: From : 10.1.1.1 (1.1.1.1) Relay nexthop : 10.1.1.1 Original nexthop: 10.1.1.1 OutLabel : NULL AS-path : (65001) 100 Origin : igp Attribute value : MED 0, localpref 100, pref-val 0, pre 255 State : valid, external-confed, best,
# Display the BGP routing table on Switch D.
[SwitchD] display bgp routing-table ipv4 Total number of routes: 1 BGP local router ID is 4.4.4.4 Status codes: * - valid, > - best, d - dampened, h - history, s - suppressed, S - stale, i - internal, e - external Origin: i - IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn * >i 9.1.1.0/24 10.1.3.1 0 100 0 100i [SwitchD] display bgp routing-table ipv4 9.1.1.0 BGP local router ID: 4.4.4.4 Local AS number: 65001 Paths: 1 available, 1 best BGP routing table information of 9.1.1.0/24: From : 10.1.3.1 (1.1.1.1) Relay nexthop : 10.1.3.1 Original nexthop: 10.1.3.1 OutLabel : NULL AS-path : 100 Origin : igp Attribute value : MED 0, localpref 100, pref-val 0, pre 255 State : valid, internal-confed, best,
The output shows the following:
Switch F can send route information to Switch B and Switch C through the confederation by establishing only an EBGP connection with Switch A.
Switch B and Switch D are in the same confederation, but belong to different sub-ASs. They obtain external route information from Switch A, and generate identical BGP route entries although they have no direct connection in between.