As shown in Figure 1, there are two ASs: 65008 and 65009. SwitchA belongs to AS 65008, and SwitchB, SwitchC, and SwitchD belong to AS 65009. A routing Protocol is required to exchange the routing information between the two ASs.
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 IBGP connections between SwitchB, SwitchC, and SwitchD.
Configure an EBGP connection between SwitchA and SwitchB.
# Configure SwitchA. The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 [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
# Configure SwitchA. The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA.
[SwitchA] ipv6 [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ipv6 enable [SwitchA-Vlanif10] ipv6 address fc00:0:0:8::1/64 [SwitchA-Vlanif10] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ipv6 enable [SwitchA-Vlanif20] ipv6 address fc00:0:0:100::2/64 [SwitchA-Vlanif20] quit
# Configure SwitchB.
[SwitchB] bgp 65009 [SwitchB-bgp] router-id 10.2.2.2 [SwitchB-bgp] peer fc00:0:0:91::2 as-number 65009 [SwitchB-bgp] peer fc00:0:0:93::2 as-number 65009 [SwitchB-bgp] ipv6-family unicast [SwitchB-bgp-af-ipv6] peer fc00:0:0:91::2 enable [SwitchB-bgp-af-ipv6] peer fc00:0:0:93::2 enable [SwitchB-bgp-af-ipv6] network fc00:0:0:91:: 64 [SwitchB-bgp-af-ipv6] network fc00:0:0:93:: 64 [SwitchB-bgp-af-ipv6] quit [SwitchB-bgp] quit
# Configure SwitchC.
[SwitchC] bgp 65009 [SwitchC-bgp] router-id 10.3.3.3 [SwitchC-bgp] peer fc00:0:0:93::1 as-number 65009 [SwitchC-bgp] peer fc00:0:0:92::2 as-number 65009 [SwitchC-bgp] ipv6-family unicast [SwitchC-bgp-af-ipv6] peer fc00:0:0:93::1 enable [SwitchC-bgp-af-ipv6] peer fc00:0:0:92::2 enable [SwitchC-bgp-af-ipv6] network fc00:0:0:93:: 64 [SwitchC-bgp-af-ipv6] network fc00:0:0:92:: 64 [SwitchC-bgp-af-ipv6] quit [SwitchC-bgp] quit
# Configure SwitchD.
[SwitchD] bgp 65009 [SwitchD-bgp] router-id 10.4.4.4 [SwitchD-bgp] peer fc00:0:0:91::1 as-number 65009 [SwitchD-bgp] peer fc00:0:0:92::1 as-number 65009 [SwitchD-bgp] ipv6-family unicast [SwitchD-bgp-af-ipv6] peer fc00:0:0:91::1 enable [SwitchD-bgp-af-ipv6] peer fc00:0:0:92::1 enable [SwitchD-bgp-af-ipv6] network fc00:0:0:92:: 64 [SwitchD-bgp-af-ipv6] network fc00:0:0:91:: 64 [SwitchD-bgp-af-ipv6] quit [SwitchD-bgp] quit
# Configure SwitchA.
[SwitchA] bgp 65008 [SwitchA-bgp] router-id 10.1.1.1 [SwitchA-bgp] peer fc00:0:0:100::1 as-number 65009 [SwitchA-bgp] ipv6-family unicast [SwitchA-bgp-af-ipv6] peer fc00:0:0:100::1 enable [SwitchA-bgp-af-ipv6] network fc00:0:0:100:: 64 [SwitchA-bgp-af-ipv6] network fc00:0:0:8:: 64 [SwitchA-bgp-af-ipv6] quit [SwitchA-bgp] quit
# Configure SwitchB.
[SwitchB] bgp 65009 [SwitchB-bgp] peer fc00:0:0:100::2 as-number 65008 [SwitchB-bgp] ipv6-family unicast [SwitchB-bgp-af-ipv6] peer fc00:0:0:100::2 enable [SwitchB-bgp-af-ipv6] network fc00:0:0:100:: 64 [SwitchB-bgp-af-ipv6] quit [SwitchB-bgp] quit
# View the status of the BGP4+ peers.
[SwitchB] display bgp ipv6 peer
BGP local router ID : 10.2.2.2
Local AS number : 65009
Total number of peers : 3 Peers in established state : 3
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
FC00:0:0:91::2 4 65009 8 9 0 00:05:37 Established 2
FC00:0:0:93::2 4 65009 2 2 0 00:00:09 Established 2
FC00:0:0:100::2 4 65008 9 7 0 00:05:38 Established 1
The preceding information shows that the BGP4+ connections between SwitchB and other Switches are set up.
# Display the routing table of SwitchA.
[SwitchA] display bgp ipv6 routing-table
BGP Local router ID is 10.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 5
*> Network : FC00:0:0:91:: PrefixLen : 64
NextHop : FC00:0:0:100::1 LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : 65009 i
*> Network : FC00:0:0:92:: PrefixLen : 64
NextHop : FC00:0:0:100::1 LocPrf :
MED : PrefVal : 0
Label :
Path/Ogn : 65009 i
*> Network : FC00:0:0:93:: PrefixLen : 64
NextHop : FC00:0:0:100::1 LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : 65009 i
*> Network : FC00:0:0:100:: PrefixLen : 64
NextHop : :: LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : i
NextHop : FC00:0:0:100::1 LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : 65009 i
The routing table shows that SwitchA has learned the route from AS 65009. AS 65008 and AS 65009 can exchange their routing information.
SwitchA configuration file
# sysname SwitchA # ipv6 # vlan batch 10 20 # interface Vlanif10 ipv6 enable ipv6 address FC00:0:0:8::1/64 # interface Vlanif20 ipv6 enable ipv6 address FC00:0:0:100::2/64 # 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 # bgp 65008 router-id 10.1.1.1 peer FC00:0:0:100::1 as-number 65009 # ipv4-family unicast undo synchronization # ipv6-family unicast undo synchronization network FC00:0:0:8:: 64 network FC00:0:0:100:: 64 peer FC00:0:0:100::1 enable # return
SwitchB configuration file
# sysname SwitchB # ipv6 # vlan batch 20 30 40 # interface Vlanif20 ipv6 enable ipv6 address FC00:0:0:100::1/64 # interface Vlanif30 ipv6 enable ipv6 address FC00:0:0:93::1/64 # interface Vlanif40 ipv6 enable ipv6 address FC00:0:0:91::1/64 # 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 20 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 30 # bgp 65009 router-id 10.2.2.2 peer FC00:0:0:91::2 as-number 65009 peer FC00:0:0:93::2 as-number 65009 peer FC00:0:0:100::2 as-number 65008 # ipv4-family unicast undo synchronization # ipv6-family unicast undo synchronization network FC00:0:0:91:: 64 network FC00:0:0:93:: 64 network FC00:0:0:100:: 64 peer FC00:0:0:91::2 enable peer FC00:0:0:93::2 enable peer FC00:0:0:100::2 enable # return
SwitchC configuration file
# sysname SwitchC # ipv6 # vlan batch 30 50 # interface Vlanif30 ipv6 enable ipv6 address FC00:0:0:93::2/64 # interface Vlanif50 ipv6 enable ipv6 address FC00:0:0:92::1/64 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 50 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 30 # bgp 65009 router-id 10.3.3.3 peer FC00:0:0:92::2 as-number 65009 peer FC00:0:0:93::1 as-number 65009 # ipv4-family unicast undo synchronization # ipv6-family unicast undo synchronization network FC00:0:0:92:: 64 network FC00:0:0:93:: 64 peer FC00:0:0:92::2 enable peer FC00:0:0:93::1 enable # return
SwitchD configuration file
# sysname SwitchD # ipv6 # vlan batch 40 50 # interface Vlanif40 ipv6 enable ipv6 address FC00:0:0:91::2/64 # interface Vlanif50 ipv6 enable ipv6 address FC00:0:0:92::2/64 # 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 65009 router-id 10.4.4.4 peer FC00:0:0:91::1 as-number 65009 peer FC00:0:0:92::1 as-number 65009 # ipv4-family unicast undo synchronization # ipv6-family unicast undo synchronization network FC00:0:0:91:: 64 network FC00:0:0:92:: 64 peer FC00:0:0:91::1 enable peer FC00:0:0:92::1 enable # return