Example for Dual-Homing a Switch to an IP Network Through V-STP
Networking Requirements
As shown in Figure 4-23, the switch is dual-homed to the IP network through M-LAG. The requirements are as follows:
- When one access link fails, traffic can be fast switched to the other link to ensure reliability.
- The load balancing mode can be used to forward traffic to make full use of bandwidth and ensure that two links are in active state.
Configuration Roadmap
The configuration roadmap is as follows:
On the switch, bind the uplink interface to an Eth-Trunk.
Configure the V-STP, DFS group, peer-link, and M-LAG interface on SwitchA and SwitchB.
On SwitchA and SwitchB, configure an IP address and a MAC address for a VLANIF interface to implement dual-active gateway of access devices.
Configure OSPF on SwitchA, SwitchB, and SwitchC to ensure Layer 3 connectivity.
In a V-STP scenario, to prevent a port from being blocked due to the spanning tree calculation result, configure the main interface to implement Layer 3 connectivity or disable the spanning tree protocol on the IP network.
On SwitchA and SwitchB, associate uplink and downlink interfaces with the Monitor Link group to prevent a user-side traffic forwarding failure and traffic loss due to the uplink fault.
Procedure
- On the switch, bind the uplink interface to an Eth-Trunk.
# Configure the switch.
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] vlan batch 11 [*Switch] interface eth-trunk 20 [*Switch-Eth-Trunk20] mode lacp-static [*Switch-Eth-Trunk20] port link-type trunk [*Switch-Eth-Trunk20] port trunk allow-pass vlan 11 [*Switch-Eth-Trunk20] trunkport 10ge 1/0/1 to 1/0/4 [*Switch-Eth-Trunk20] quit [*Switch] commit
- Configure the V-STP, DFS group, peer-link, and M-LAG interface on SwitchA and SwitchB.
# Configure SwitchA.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] stp mode rstp [~SwitchA] stp bridge-address 1-1-1 [*SwitchA] stp v-stp enable [*SwitchA] interface loopback 0 [*SwitchA-LoopBack0] ip address 10.1.1.1 32 [*SwitchA-LoopBack0] quit [*SwitchA] dfs-group 1 [*SwitchA-dfs-group-1] source ip 10.1.1.1 [*SwitchA-dfs-group-1] priority 150 [*SwitchA-dfs-group-1] quit [*SwitchA] interface eth-trunk 1 [*SwitchA-Eth-Trunk1] trunkport 10ge 1/0/4 [*SwitchA-Eth-Trunk1] trunkport 10ge 2/0/5 [*SwitchA-Eth-Trunk1] mode lacp-static [*SwitchA-Eth-Trunk1] peer-link 1 [*SwitchA-Eth-Trunk1] quit [*SwitchA] vlan batch 11 [*SwitchA] interface eth-trunk 10 [*SwitchA-Eth-Trunk10] mode lacp-static [*SwitchA-Eth-Trunk10] port link-type trunk [*SwitchA-Eth-Trunk10] port trunk allow-pass vlan 11 [*SwitchA-Eth-Trunk10] trunkport 10ge 1/0/2 [*SwitchA-Eth-Trunk10] trunkport 10ge 1/0/3 [*SwitchA-Eth-Trunk10] dfs-group 1 m-lag 1 [*SwitchA-Eth-Trunk10] quit [*SwitchA] commit
# Configure SwitchB.
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] stp mode rstp [~SwitchB] stp bridge-address 1-1-1 [*SwitchB] stp v-stp enable [*SwitchB] interface loopback 0 [*SwitchB-LoopBack0] ip address 10.1.1.2 32 [*SwitchB-LoopBack0] quit [*SwitchB] dfs-group 1 [*SwitchB-dfs-group-1] source ip 10.1.1.2 [*SwitchB-dfs-group-1] priority 120 [*SwitchB-dfs-group-1] quit [*SwitchB] interface eth-trunk 1 [*SwitchB-Eth-Trunk1] trunkport 10ge 1/0/4 [*SwitchB-Eth-Trunk1] trunkport 10ge 2/0/5 [*SwitchB-Eth-Trunk1] mode lacp-static [*SwitchB-Eth-Trunk1] peer-link 1 [*SwitchB-Eth-Trunk1] quit [*SwitchB] vlan batch 11 [*SwitchB] interface eth-trunk 10 [*SwitchB-Eth-Trunk10] mode lacp-static [*SwitchB-Eth-Trunk10] port link-type trunk [*SwitchB-Eth-Trunk10] port trunk allow-pass vlan 11 [*SwitchB-Eth-Trunk10] trunkport 10ge 1/0/2 [*SwitchB-Eth-Trunk10] trunkport 10ge 1/0/3 [*SwitchB-Eth-Trunk10] dfs-group 1 m-lag 1 [*SwitchB-Eth-Trunk10] quit [*SwitchB] commit
- On SwitchA and SwitchB, configure an IP address and a MAC address for a VLANIF interface to implement dual-active gateway of access devices.
VLANIF interfaces corresponding to M-LAG member interfaces of M-LAG master and backup devices must be configured with the same IP address and MAC address so that M-LAG devices use the same virtual IP address and virtual MAC address.
# Configure SwitchA.[~SwitchA] interface vlanif 11 [*SwitchA-Vlanif11] ip address 10.2.1.1 24 [*SwitchA-Vlanif11] mac-address 0000-5e00-0101 [*SwitchA-Vlanif11] quit [*SwitchA] commit
# Configure SwitchB.[~SwitchB] interface vlanif 11 [*SwitchB-Vlanif11] ip address 10.2.1.1 24 [*SwitchB-Vlanif11] mac-address 0000-5e00-0101 [*SwitchB-Vlanif11] quit [*SwitchB] commit
- Configure OSPF on SwitchA, SwitchB, and SwitchC to ensure Layer 3 connectivity.# Configure SwitchA.
[~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] undo portswitch [*SwitchA-10GE1/0/1] ip address 10.3.1.1 24 [*SwitchA-10GE1/0/1] quit [*SwitchA] ospf 1 [*SwitchA-ospf-1] area 0 [*SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.0 [*SwitchA-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [*SwitchA-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [*SwitchA-ospf-1-area-0.0.0.0] quit [*SwitchA-ospf-1] quit [*SwitchA] commit
# Configure SwitchB.[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] undo portswitch [*SwitchB-10GE1/0/1] ip address 10.4.1.1 24 [*SwitchB-10GE1/0/1] quit [*SwitchB] ospf 1 [*SwitchB-ospf-1] area 0 [*SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.0 [*SwitchB-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [*SwitchB-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255 [*SwitchB-ospf-1-area-0.0.0.0] quit [*SwitchB-ospf-1] quit [*SwitchB] commit
# Configure SwitchC.
<HUAWEI> system-view [~HUAWEI] sysname SwitchC [*HUAWEI] commit [~SwitchC] interface 10ge 1/0/1 [~SwitchC-10GE1/0/1] undo portswitch [*SwitchC-10GE1/0/1] ip address 10.3.1.2 24 [*SwitchC-10GE1/0/1] quit [*SwitchC] interface 10ge 1/0/2 [*SwitchC-10GE1/0/2] undo portswitch [*SwitchC-10GE1/0/2] ip address 10.4.1.2 24 [*SwitchC-10GE1/0/2] quit [*SwitchC] ospf 1 [*SwitchC-ospf-1] area 0 [*SwitchC-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [*SwitchC-ospf-1-area-0.0.0.0] network 10.4.1.0 0.0.0.255 [*SwitchC-ospf-1-area-0.0.0.0] quit [*SwitchC-ospf-1] quit
- On SwitchA and SwitchB, associate uplink and downlink interfaces with the Monitor Link group.# Configure SwitchA.
[~SwitchA] monitor-link group 1 [*SwitchA-mtlk-group1] port 10ge 1/0/1 uplink [*SwitchA-mtlk-group1] port eth-trunk 10 downlink 1 [*SwitchA-mtlk-group1] quit [*SwitchA] commit
# Configure SwitchB.[~SwitchB] monitor-link group 1 [*SwitchB-mtlk-group1] port 10ge 1/0/1 uplink [*SwitchB-mtlk-group1] port eth-trunk 10 downlink 1 [*SwitchB-mtlk-group1] quit [*SwitchB] commit
- Verify the configuration.
Run the display dfs-group command to check M-LAG information.
# Check information about the M-LAG with DFS group 1.
[~SwitchA] display dfs-group 1 m-lag * : Local node Heart beat state : OK Node 1 * Dfs-Group ID : 1 Priority : 150 Address : ip address 10.1.1.1 State : Master Causation : - System ID : 0025-9e95-7c31 SysName : SwitchA Version : V100R006C00 Device Type : CE12800 Node 2 Dfs-Group ID : 1 Priority : 120 Address : ip address 10.1.1.2 State : Backup Causation : - System ID : 0025-9e95-7c11 SysName : SwitchB Version : V100R006C00 Device Type : CE12800
# Check M-LAG information on SwitchA.
[~SwitchA] display dfs-group 1 node 1 m-lag brief * - Local node M-Lag ID Interface Port State Status 1 Eth-Trunk 10 Up active(*)-active
# Check M-LAG information on SwitchB.
[~SwitchB] display dfs-group 1 node 2 m-lag brief * - Local node M-Lag ID Interface Port State Status 1 Eth-Trunk 10 Up active-active(*)
In the preceding command outputs, the value of Heart beat state is OK, indicating that the heartbeat is normal. SwitchA is used as Node 1, its priority is 150, and its status is Master. SwitchB is used as Node 2, its priority is 120, and its status is Backup. The value of Causation is -, the values of Port State of Node 1 and Node 2 are both Up, and the M-LAG status of both Node 1 and Node 2 is active, indicating that the M-LAG configuration is correct.
Configuration Files
SwitchA configuration file
# sysname SwitchA # dfs-group 1 priority 150 source ip 10.1.1.1 # vlan batch 11 # stp mode rstp stp bridge-address 0001-0001-0001 stp v-stp enable # interface Vlanif11 ip address 10.2.1.1 255.255.255.0 mac-address 0000-5e00-0101 # interface Eth-Trunk1 mode lacp-static peer-link 1 # interface Eth-Trunk10 port link-type trunk port trunk allow-pass vlan 11 mode lacp-static dfs-group 1 m-lag 1 # interface 10GE1/0/1 undo portswitch ip address 10.3.1.1 255.255.255.0 # interface 10GE1/0/2 eth-trunk 10 # interface 10GE1/0/3 eth-trunk 10 # interface 10GE1/0/4 eth-trunk 1 # interface 10GE2/0/5 eth-trunk 1 # interface LoopBack0 ip address 10.1.1.1 255.255.255.255 # monitor-link group 1 port 10GE1/0/1 uplink port Eth-Trunk10 downlink 1 # ospf 1 area 0.0.0.0 network 10.1.1.1 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # return
SwitchB configuration file
# sysname SwitchB # dfs-group 1 priority 120 source ip 10.1.1.2 # vlan batch 11 # stp mode rstp stp bridge-address 0001-0001-0001 stp v-stp enable # interface Vlanif11 ip address 10.2.1.1 255.255.255.0 mac-address 0000-5e00-0101 # interface Eth-Trunk1 mode lacp-static peer-link 1 # interface Eth-Trunk10 port link-type trunk port trunk allow-pass vlan 11 mode lacp-static dfs-group 1 m-lag 1 # interface 10GE1/0/1 undo portswitch ip address 10.4.1.1 255.255.255.0 # interface 10GE1/0/2 eth-trunk 10 # interface 10GE1/0/3 eth-trunk 10 # interface 10GE1/0/4 eth-trunk 1 # interface 10GE2/0/5 eth-trunk 1 # interface LoopBack0 ip address 10.1.1.2 255.255.255.255 # monitor-link group 1 port 10GE1/0/1 uplink port Eth-Trunk10 downlink 1 # ospf 1 area 0.0.0.0 network 10.1.1.2 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return
SwitchC configuration file
# sysname SwitchC # interface 10GE1/0/1 undo portswitch ip address 10.3.1.2 255.255.255.0 # interface 10GE1/0/2 undo portswitch ip address 10.4.1.2 255.255.255.0 # ospf 1 area 0.0.0.0 network 10.3.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return
Switch configuration file
# sysname Switch # vlan batch 11 # interface Eth-Trunk20 port link-type trunk port trunk allow-pass vlan 11 mode lacp-static # interface 10GE1/0/1 eth-trunk 20 # interface 10GE1/0/2 eth-trunk 20 # interface 10GE1/0/3 eth-trunk 20 # interface 10GE1/0/4 eth-trunk 20 # return