天天看點

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

模拟器實驗拓撲圖

實驗結果:

①企業内部PC機實作網絡互通

②LSW1和LSW2交換機實作流量負載均衡,

LSW1通過vlan 10 20 流量,LSW2通過vlan 30 40 流量

③外網用戶端能夠通路内網伺服器

LSW3,LSW4,LSW5,LSW6 為接入交換機

LSW1、LSW2核心交換機

AR2出口路由器

實驗配置如下:

接入交換機配置:

------------------- LSW3 ---------------------
sys
sys LSW3
vlan batch 10 20 5
int e0/0/1
port link-type access
port default vlan 10
int e0/0/2
port link-type access
port default vlan 20
int e0/0/5
port link-type trunk
port trunk allow-pass vlan 10 20 5
int e0/0/6
port link-type trunk
port trunk allow-pass vlan 10 20 5
q
int vlanif 5
ip add 192.168.5.1 24
q

stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30
instance 40 vlan 40
instance 5 vlan 50
active region-configuration
q           
---------------- LSW2 ---------------------
  sys
sys LSW4
vlan batch 30 5
int e0/0/1
port link-type access
port default vlan 30
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 30 5
int e0/0/2
port link-type trunk
port trunk allow-pass vlan 30 5
q
int vlanif 5
ip add 192.168.5.2 24
q

stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30
instance 40 vlan 40
instance 5 vlan 50
active region-configuration
q           
------------------- LSW5 --------------------
sys
sys LSW5
vlan batch 40 5

int e0/0/1
port link-type access
port default vlan 40
int e0/0/3
port link-type trunk
port trunk allow-pass vlan 40 5
int e0/0/2
port link-type trunk
port trunk allow-pass vlan 40 5
q
int vlanif 5
ip add 192.168.5.3 24
q

stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30
instance 40 vlan 40
instance 5 vlan 50
active region-configuration
q           
-------------------- LSW6 --------------------
sys
sys LSW6
vlan batch 50 5

port-group 1
group-member e0/0/1 to e0/0/3
port link-type access
port default vlan 50
q
int e0/0/4
port link-type trunk
port trunk allow-pass vlan 50 5
int e0/0/5
port link-type trunk
port trunk allow-pass vlan 50 5
q
int vlanif 5
ip add 192.168.5.4 24
q
stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30
instance 40 vlan 40
instance 5 vlan 50
active region-configuration
q           

核心交換機配置LSW1

sys
sys LSW1
vlan batch 10 20 30 40 50 100 200 5
int g0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 5
int g0/0/2
port link-type trunk
port trunk allow-pass vlan 30 5
int g0/0/3
port link-type trunk
port trunk allow-pass vlan 40 5
int g0/0/4
port link-type trunk
port trunk allow-pass vlan 50 5
q
int Eth-trunk 1
mode lacp-static
trunkport GigabitEthernet 0/0/6 0/0/7
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 5 
q
stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30
instance 40 vlan 40
instance 5 vlan 50  #
active region-configuration
q
stp instance 10 root primary
stp instance 20 root secondary
stp instance 30 root primary
stp instance 40 root secondary
stp instance 5 root primary 

int vlanif 10
ip add 192.168.10.250 24
q
int vlanif 20
ip add 192.168.20.250 24
q
int vlanif 30 
ip add 192.168.30.250 24
q
int vlanif 40
ip add 192.168.40.250 24
q
int vlanif 50
ip add 192.168.50.250 24
q
int vlanif 5
ip add 192.168.5.5 24
q

int vlanif 10
vrrp vrid 1 virtual-ip 192.168.10.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
q
int vlanif 20
vrrp vrid 2 virtual-ip 192.168.20.254
q
int vlanif 30
vrrp vrid 3 virtual-ip 192.168.30.254
vrrp vrid 3 priority 120
vrrp vrid 3 preempt-mode timer delay 20
q
int vlanif 40
vrrp vrid 4 virtual-ip 192.168.40.254
q
int vlanif 50
vrrp vrid 5 virtual-ip 192.168.50.254
vrrp vrid 5 priority 120
vrrp vrid 5 preempt-mode timer delay 20
q

dhcp enable
ip pool pool10
gateway-list 192.168.10.254
network 192.168.10.0 mask 24
dns-list 114.114.114.114
excluded-ip-address 192.168.10.127 192.168.10.253
q
int vlanif 10 
dhcp select global
q
ip pool pool20
gateway-list 192.168.20.254
dns-list 114.114.114.114
network 192.168.20.0 mask 24
excluded-ip-address 192.168.20.127 192.168.20.253
q
int vlanif 20
dhcp select global
q


int vlanif 100
ip add 172.16.1.1 24
q
int g0/0/5
port link-type access
port default vlan 100
q

ospf 1 routerid 2.2.2.2
area 0
net 192.168.10.0 0.0.0.255
net 192.168.20.0 0.0.0.255
net 192.168.30.0 0.0.0.255
net 192.168.40.0 0.0.0.255
net 172.16.1.1 0.0.0.0           

核心交換機配置LSW2

sys
sys SWL2
vlan batch 10 20 30 40 50 100 200 5
int g0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 5
int g0/0/2
port link-type trunk
port trunk allow-pass vlan 30 5
int g0/0/3
port link-type trunk
port trunk allow-pass vlan 40 5
int g0/0/4
port link-type trunk
port trunk allow-pass vlan 50 5
q
int Eth-trunk 1
mode lacp-static
trunkport GigabitEthernet 0/0/6 0/0/7
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 5
q
stp region-configuration
region-name huawei
instance 10 vlan 10
instance 20 vlan 20
instance 30 vlan 30 
instance 40 vlan 40
instance 5 vlan 50  #
active region-configuration
q
stp instance 10 root secondary
stp instance 20 root primary
stp instance 30 root secondary
stp instance 40 root primary
stp instance 5 root secondary

int vlanif 10
ip add 192.168.10.251 24
q
int vlanif 20
ip add 192.168.20.251 24
q
int vlanif 30 
ip add 192.168.30.251 24
q
int vlanif 40
ip add 192.168.40.251 24
q
int vlanif 50
ip add 192.168.50.251 24
q
int vlanif 5
ip add 192.168.5.251 24
q

int vlanif 10
vrrp vrid 1 virtual-ip 192.168.10.254
q
int vlanif 20
vrrp vrid 2 virtual-ip 192.168.20.254
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 20
q
int vlanif 30
vrrp vrid 3 virtual-ip 192.168.30.254
q
int vlanif 40
vrrp vrid 4 virtual-ip 192.168.40.254
vrrp vrid 4 priority 120
vrrp vrid 4 preempt-mode timer delay 120
q
int vlanif 50
vrrp vrid 5 virtual-ip 192.168.50.254
q

dhcp enable
ip pool pool10
gateway-list 192.168.10.254
dns-list 114.114.114.114
network 192.168.10.0 mask 24
excluded-ip-address 192.168.10.1 192.168.10.126
q
int vlanif 10
dhcp select global
q
ip pool pool20
gateway-list 192.168.20.254
dns-list 114.114.114.114
network 192.168.20.0 mask 24
excluded-ip-address 192.168.20.1 192.168.20.126
q
int vlanif 20
dhcp select global
q


int vlanif 200
ip add 172.16.2.1 24
q
int g0/0/5
port link-type access
port default vlan 200
q

ospf 1 router-id 3.3.3.3
area 0
net 192.168.10.0 0.0.0.255
net 192.168.20.0 0.0.0.255
net 192.168.30.0 0.0.0.255
net 192.168.40.0 0.0.0.255
net 172.16.2.1 0.0.0.0           

出口路由器AR2

sys
sys R2
int g0/0/0
ip add 172.16.1.2 24
int g0/0/1
ip add 172.16.2.2 24
int g0/0/2
ip add 1.1.1.1 24

ip route-static 0.0.0.0 0 1.1.1.2

ospf 1 route-id 1.1.1.1
default-route-advertise always
area 0
net 172.16.1.2 0.0.0.0
net 172.16.2.2 0.0.0.0
q
q
acl 2000
rule permit source any
q
int g0/0/2
nat outbound 2000
nat server protocol tcp global current-interface 80 inside 192.168.50.1 80
q
           

公網路由器AR3

sys 
sys R3
int g0/0/1
ip add 1.1.1.2 24
int loopback 1
ip add 2.2.2.2 24
q
int g0/0/0
ip add 3.3.3.254 24
q           

實驗結果驗證:

①内網互通

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan10 網絡通路 vlan 30 50網絡

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan10 通路 vlan 20

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan10 通路 vlan 40

②LSW1和LSW2交換機實作流量負載均衡

LSW1通過vlan 10 20 流量,LSW2通過vlan 30 40 流量

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan10流量走向

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan 20流量走向

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan 30流量走向

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan 40流量走向

當LSW2交換機down時,vlan 40流量走向

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

vlan 40流量走向

③外網用戶端能夠通路内網伺服器

華為模拟器實作vrrp+mstp+鍊路聚合綜合組網實驗

外網通路内網www伺服器

2022年11月9日筆記

繼續閱讀