BGP confederation configuration example
Network requirements
As shown in Figure 74, split AS 200 into three sub-ASs (AS 65001, AS 65002, and AS 65003) to reduce IBGP connections. Switches in AS 65001 are fully meshed.
Figure 74: Network diagram
Table 17: 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-default] router-id 1.1.1.1 [SwitchA-bgp-default] confederation id 200 [SwitchA-bgp-default] confederation peer-as 65002 65003 [SwitchA-bgp-default] peer 10.1.1.2 as-number 65002 [SwitchA-bgp-default] peer 10.1.2.2 as-number 65003 [SwitchA-bgp-default] address-family ipv4 unicast [SwitchA-bgp-default-ipv4] peer 10.1.1.2 enable [SwitchA-bgp-default-ipv4] peer 10.1.2.2 enable [SwitchA-bgp-default-ipv4] peer 10.1.1.2 next-hop-local [SwitchA-bgp-default-ipv4] peer 10.1.2.2 next-hop-local [SwitchA-bgp-default-ipv4] quit [SwitchA-bgp-default] quit
# Configure Switch B.
<SwitchB> system-view [SwitchB] bgp 65002 [SwitchB-bgp-default] router-id 2.2.2.2 [SwitchB-bgp-default] confederation id 200 [SwitchB-bgp-default] confederation peer-as 65001 65003 [SwitchB-bgp-default] peer 10.1.1.1 as-number 65001 [SwitchB-bgp-default] address-family ipv4 unicast [SwitchB-bgp-default-ipv4] peer 10.1.1.1 enable [SwitchB-bgp-default-ipv4] quit [SwitchB-bgp-default] quit
# Configure Switch C.
<SwitchC> system-view [SwitchC] bgp 65003 [SwitchC-bgp-default] router-id 3.3.3.3 [SwitchC-bgp-default] confederation id 200 [SwitchC-bgp-default] confederation peer-as 65001 65002 [SwitchC-bgp-default] peer 10.1.2.1 as-number 65001 [SwitchC-bgp-default] address-family ipv4 unicast [SwitchC-bgp-default-ipv4] peer 10.1.2.1 enable [SwitchC-bgp-default-ipv4] quit [SwitchC-bgp-default] quit
Configure IBGP connections in AS 65001:
# Configure Switch A.
[SwitchA] bgp 65001 [SwitchA-bgp-default] peer 10.1.3.2 as-number 65001 [SwitchA-bgp-default] peer 10.1.4.2 as-number 65001 [SwitchA-bgp-default] address-family ipv4 unicast [SwitchA-bgp-default-ipv4] peer 10.1.3.2 enable [SwitchA-bgp-default-ipv4] peer 10.1.4.2 enable [SwitchA-bgp-default-ipv4] peer 10.1.3.2 next-hop-local [SwitchA-bgp-default-ipv4] peer 10.1.4.2 next-hop-local [SwitchA-bgp-default-ipv4] quit [SwitchA-bgp-default] quit
# Configure Switch D.
<SwitchD> system-view [SwitchD] bgp 65001 [SwitchD-bgp-default] router-id 4.4.4.4 [SwitchD-bgp-default] confederation id 200 [SwitchD-bgp-default] peer 10.1.3.1 as-number 65001 [SwitchD-bgp-default] peer 10.1.5.2 as-number 65001 [SwitchD-bgp-default] address-family ipv4 unicast [SwitchD-bgp-default-ipv4] peer 10.1.3.1 enable [SwitchD-bgp-default-ipv4] peer 10.1.5.2 enable [SwitchD-bgp-default-ipv4] quit [SwitchD-bgp-default] quit
# Configure Switch E.
<SwitchE> system-view [SwitchE] bgp 65001 [SwitchE-bgp-default] router-id 5.5.5.5 [SwitchE-bgp-default] confederation id 200 [SwitchE-bgp-default] peer 10.1.4.1 as-number 65001 [SwitchE-bgp-default] peer 10.1.5.1 as-number 65001 [SwitchE-bgp-default] address-family ipv4 unicast [SwitchE-bgp-default-ipv4] peer 10.1.4.1 enable [SwitchE-bgp-default-ipv4] peer 10.1.5.1 enable [SwitchE-bgp-default-ipv4] quit [SwitchE-bgp-default] quit
Configure the EBGP connection between AS 100 and AS 200:
# Configure Switch A.
[SwitchA] bgp 65001 [SwitchA-bgp-default] peer 200.1.1.2 as-number 100 [SwitchA-bgp-default] address-family ipv4 unicast [SwitchA-bgp-default-ipv4] peer 200.1.1.2 enable [SwitchA-bgp-default-ipv4] quit [SwitchA-bgp-default] quit
# Configure Switch F.
<SwitchF> system-view [SwitchF] bgp 100 [SwitchF-bgp-default] router-id 6.6.6.6 [SwitchF-bgp-default] peer 200.1.1.1 as-number 200 [SwitchF-bgp-default] address-family ipv4 unicast [SwitchF-bgp-default-ipv4] peer 200.1.1.1 enable [SwitchF-bgp-default-ipv4] network 9.1.1.0 255.255.255.0 [SwitchF-bgp-default-ipv4] quit [SwitchF-bgp-default] 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) Rely 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 IP precedence : N/A QoS local ID : N/A Traffic index : N/A
# 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) Rely 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 IP precedence : N/A QoS local ID : N/A Traffic index : N/A
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.