In Figure 1, there are multiple BGP switches in AS 200. It is required that the number of IBGP connections be reduced.
In this scenario, ensure that all connected interfaces have STP disabled. If STP is enabled and VLANIF interfaces of switches are used to construct a Layer 3 ring network, an interface on the network will be blocked. As a result, Layer 3 services on the network cannot run normally.
The configuration roadmap is as follows:
Configure a BGP confederation on each switch in AS 200 to divide AS 200 into three sub-ASs: AS 65001, AS 65002, and AS 65003. Three switches in AS 65001 establish full-mesh IBGP connections to reduce the number of IBGP connections.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 30 40 60 [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type trunk [SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 20 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type trunk [SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 30 [SwitchA-GigabitEthernet0/0/3] quit [SwitchA] interface gigabitethernet 0/0/4 [SwitchA-GigabitEthernet0/0/4] port link-type trunk [SwitchA-GigabitEthernet0/0/4] port trunk allow-pass vlan 40 [SwitchA-GigabitEthernet0/0/4] quit [SwitchA] interface gigabitethernet 0/0/5 [SwitchA-GigabitEthernet0/0/5] port link-type trunk [SwitchA-GigabitEthernet0/0/5] port trunk allow-pass vlan 60 [SwitchA-GigabitEthernet0/0/5] quit
The configurations of SwitchB, SwitchC, SwitchD, SwitchE, and SwitchF are similar to the configuration of SwitchA, and are not mentioned here.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 10.1.1.1 24 [SwitchA-Vlanif10] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 10.1.2.1 24 [SwitchA-Vlanif20] quit [SwitchA] interface vlanif 30 [SwitchA-Vlanif30] ip address 10.1.3.1 24 [SwitchA-Vlanif30] quit [SwitchA] interface vlanif 40 [SwitchA-Vlanif40] ip address 10.1.4.1 24 [SwitchA-Vlanif40] quit [SwitchA] interface vlanif 60 [SwitchA-Vlanif60] ip address 192.168.1.1 24 [SwitchA-Vlanif60] quit
The configurations of SwitchB, SwitchC, SwitchD, SwitchE, and SwitchF are similar to the configuration of SwitchA, and are not mentioned here.
# Configure SwitchA.
[SwitchA] bgp 65001 [SwitchA-bgp] router-id 172.16.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] ipv4-family unicast [SwitchA-bgp-af-ipv4] peer 10.1.1.2 next-hop-local [SwitchA-bgp-af-ipv4] peer 10.1.2.2 next-hop-local [SwitchA-bgp-af-ipv4] quit [SwitchA-bgp] quit
# Configure SwitchB.
[SwitchB] bgp 65002 [SwitchB-bgp] router-id 172.16.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] quit
# Configure SwitchC.
[SwitchC] bgp 65003 [SwitchC-bgp] router-id 172.16.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] quit
# Configure SwitchA.
[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] ipv4-family unicast [SwitchA-bgp-af-ipv4] peer 10.1.3.2 next-hop-local [SwitchA-bgp-af-ipv4] peer 10.1.4.2 next-hop-local [SwitchA-bgp-af-ipv4] quit
# Configure SwitchD.
[SwitchD] bgp 65001 [SwitchD-bgp] router-id 172.16.4.4 [SwitchD-bgp] peer 10.1.3.1 as-number 65001 [SwitchD-bgp] peer 10.1.5.2 as-number 65001 [SwitchD-bgp] quit
# Configure SwitchE.
[SwitchE] bgp 65001 [SwitchE-bgp] router-id 172.16.5.5 [SwitchE-bgp] peer 10.1.4.1 as-number 65001 [SwitchE-bgp] peer 10.1.5.1 as-number 65001 [SwitchE-bgp] quit
# Configure SwitchA.
[SwitchA] bgp 65001 [SwitchA-bgp] peer 192.168.1.2 as-number 100 [SwitchA-bgp] quit
# Configure SwitchF.
[SwitchF] bgp 100 [SwitchF-bgp] router-id 172.16.6.6 [SwitchF-bgp] peer 192.168.1.1 as-number 200 [SwitchF-bgp] ipv4-family unicast [SwitchF-bgp-af-ipv4] network 10.0.1.0 255.255.255.0 [SwitchF-bgp-af-ipv4] quit [SwitchF-bgp] quit
# Check the BGP routing table of SwitchB.
[SwitchB] display bgp routing-table BGP Local router ID is 172.16.2.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 1 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 10.0.1.0/24 10.1.1.1 0 100 0 (65001) 100i [SwitchB] display bgp routing-table 10.0.1.0 BGP local router ID : 172.16.2.2 Local AS number : 65002 Paths: 1 available, 1 best, 1 select BGP routing table entry information of 10.0.1.0/24: From: 10.1.1.1 (172.16.1.1) Route Duration: 00h01m22s Relay IP Nexthop: 0.0.0.0 Relay IP Out-Interface: Vlanif10 Original nexthop: 10.1.1.1 Qos information : 0x0 AS-path (65001) 100, origin igp, MED 0, localpref 100, pref-val 0, valid, external-confed, best,select, active, pre 255 Not advertised to any peer yet
# Check the BGP routing table of SwitchD.
[SwitchD] display bgp routing-table BGP Local router ID is 172.16.4.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 1 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 10.0.1.0/24 10.1.3.1 0 100 0 100i [SwitchD] display bgp routing-table 10.0.1.0 BGP local router ID : 172.16.4.4 Local AS number : 65001 Paths: 1 available, 1 best, 1 select BGP routing table entry information of 10.0.1.0/24: From: 10.1.3.1 (172.16.1.1) Route Duration: 00h18m34s Relay IP Nexthop: 0.0.0.0 Relay IP Out-Interface: Vlanif30 Original nexthop: 10.1.3.1 Qos information : 0x0 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best,select, active, pre 255 Not advertised to any peer yet
SwitchA configuration file
# sysname SwitchA # vlan batch 10 20 30 40 60 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface Vlanif20 ip address 10.1.2.1 255.255.255.0 # interface Vlanif30 ip address 10.1.3.1 255.255.255.0 # interface Vlanif40 ip address 10.1.4.1 255.255.255.0 # interface Vlanif60 ip address 192.168.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 30 # interface GigabitEthernet0/0/4 port link-type trunk port trunk allow-pass vlan 40 # interface GigabitEthernet0/0/5 port link-type trunk port trunk allow-pass vlan 60 # bgp 65001 router-id 172.16.1.1 confederation id 200 confederation peer-as 65002 65003 peer 10.1.1.2 as-number 65002 peer 10.1.2.2 as-number 65003 peer 10.1.3.2 as-number 65001 peer 10.1.4.2 as-number 65001 peer 192.168.1.2 as-number 100 # ipv4-family unicast undo synchronization peer 10.1.1.2 enable peer 10.1.1.2 next-hop-local peer 10.1.2.2 enable peer 10.1.2.2 next-hop-local peer 10.1.3.2 enable peer 10.1.3.2 next-hop-local peer 10.1.4.2 enable peer 10.1.4.2 next-hop-local peer 192.168.1.2 enable # return
SwitchB configuration file
# sysname SwitchB # vlan batch 10 # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # bgp 65002 router-id 172.16.2.2 confederation id 200 confederation peer-as 65001 65003 peer 10.1.1.1 as-number 65001 # ipv4-family unicast undo synchronization peer 10.1.1.1 enable # return
SwitchC configuration file
# sysname SwitchC # vlan batch 20 # interface Vlanif20 ip address 10.1.2.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # bgp 65003 router-id 172.16.3.3 confederation id 200 confederation peer-as 65001 65002 peer 10.1.2.1 as-number 65001 # ipv4-family unicast undo synchronization peer 10.1.2.1 enable # return
SwitchD configuration file
# sysname SwitchD # vlan batch 30 50 # interface Vlanif30 ip address 10.1.3.2 255.255.255.0 # interface Vlanif50 ip address 10.1.5.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 30 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 50 # bgp 65001 router-id 172.16.4.4 peer 10.1.3.1 as-number 65001 peer 10.1.5.2 as-number 65001 # ipv4-family unicast undo synchronization peer 10.1.3.1 enable peer 10.1.5.2 enable # return
SwitchE configuration file
# sysname SwitchE # vlan batch 40 50 # interface Vlanif40 ip address 10.1.4.2 255.255.255.0 # interface Vlanif50 ip address 10.1.5.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 40 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 50 # bgp 65001 router-id 172.16.5.5 peer 10.1.4.1 as-number 65001 peer 10.1.5.1 as-number 65001 # ipv4-family unicast undo synchronization peer 10.1.4.1 enable peer 10.1.5.1 enable # return
SwitchF configuration file
# sysname SwitchF # vlan batch 60 70 # interface Vlanif60 ip address 192.168.1.2 255.255.255.0 # interface Vlanif70 ip address 10.0.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 60 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 70 # bgp 100 router-id 172.16.6.6 peer 192.168.1.1 as-number 200 # ipv4-family unicast undo synchronization network 10.0.1.0 255.255.255.0 peer 192.168.1.1 enable # return