採用雙smart-link組,實現兩路冗餘及流量負載均衡。負載均衡
在SW1建立兩個smart-link組ide
須要兩個保護VLAN,這裏提早規劃,VLAN10做爲smart-link組1的保護VLAN,VLAN20做爲smart-link組2的保護VLANoop
SW1:ui
[H3C]sysname SW1 [SW1]vl 10 [SW1-vlan10]qu [SW1]vl 20 [SW1-vlan20]qu [SW1]vl 30 [SW1-vlan30]qu [SW1]vl 40 [SW1-vlan40]qu [SW1] [SW1]stp region-configuration [SW1-mst-region]region-name H3C.COM [SW1-mst-region]instance 0 vlan 10 30 [SW1-mst-region]instance 1 vlan 20 40 [SW1-mst-region]active region-configuration [SW1-mst-region]quit [SW1]int ran gi 1/0/1 to gi 1/0/2 [SW1-if-range]po li tr [SW1-if-range]undo po tr pe vlan 1 [SW1-if-range]po tr pe vlan 10 20 30 40 [SW1-if-range]smart-link flush enable control-vlan 10 20 [SW1-if-range]undo stp en [SW1-if-range]qu [SW1]smart-link group 1 [SW1-smlk-group1]protected-vlan reference-instance 0 [SW1-smlk-group1]flush enable control-vlan 10 [SW1-smlk-group1]po gi 1/0/1 primary [SW1-smlk-group1]po gi 1/0/2 secondary [SW1-smlk-group1]quit [SW1] [SW1]smart-link group 2 [SW1-smlk-group2]protected-vlan reference-instance 1 [SW1-smlk-group2]flush enable control-vlan 20 [SW1-smlk-group2]port gi 1/0/2 primary [SW1-smlk-group2]port GigabitEthernet 1/0/1 secondary [SW1-smlk-group2]quit [SW1]
SW2:code
[H3C]sysname SW2 [SW2]vl 10 [SW2-vlan10]qu [SW2]vl 20 [SW2-vlan20]qu [SW2]vl 30 [SW2-vlan30]qu [SW2]vl 40 [SW2-vlan40]qu [SW2]int ran gi 1/0/1 to gi 1/0/2 [SW2-if-range]po li tr [SW2-if-range]undo po tr pe vlan 1 [SW2-if-range]po tr pe vlan 10 20 30 40 [SW2-if-range]smart-link flush enable control-vlan 10 20 [SW2-if-range]quit [SW2]monitor-link group 1 [SW2-mtlk-group1]port gi 1/0/1 uplink [SW2-mtlk-group1]port gi 1/0/2 downlink [SW2-mtlk-group1]quit [SW3]vlan 10 [SW3-vlan10]qu [SW3]vl 20 [SW3-vlan20]qu [SW3]vl 30 [SW3-vlan30]qu [SW3]vl 40 [SW3-vlan40]qu [SW3]int ran gi 1/0/1 to gi 1/0/2 [SW3-if-range]po li tr [SW3-if-range]undo po tr pe vlan 1 [SW3-if-range]po tr pe vlan 10 20 30 40 [SW3-if-range]smart-link flush enable co [SW3-if-range]smart-link flush enable control-vlan 10 20 [SW3-if-range]quit [SW3]monitor-link group 1 [SW3-mtlk-group1]port gi 1/0/1 uplink [SW3-mtlk-group1]port GigabitEthernet 1/0/2 downlink [SW3-mtlk-group1]quit [SW3]
SW4(網關所在設備):blog
[H3C]sysname SW4 [SW4]vlan 10 [SW4-vlan10]qu [SW4]vlan 20 [SW4-vlan20]quit [SW4]vlan 30 [SW4-vlan30]quit [SW4]vlan 40 [SW4-vlan40]quit [SW4]int ran gi 1/0/1 to gi 1/0/2 [SW4-if-range]po li tr [SW4-if-range]undo po tr pe vlan 1 [SW4-if-range]po tr pe vlan 10 20 30 40 [SW4-if-range]smart-link flush enable control-vlan 10 20 [SW4-if-range]quit [SW4]int vlan 30 [SW4-Vlan-interface30]ip address 192.168.30.254 24 [SW4-Vlan-interface30]undo shutdown [SW4-Vlan-interface30]quit [SW4]int vlan 40 [SW4-Vlan-interface40]ip address 192.168.40.254 24 [SW4-Vlan-interface40]undo shutdown [SW4-Vlan-interface40]quit [SW4]int LoopBack 0 [SW4-LoopBack0]ip address 1.1.1.1 30 [SW4-LoopBack0]undo shutdown [SW4-LoopBack0]quit [SW4]