本实验重点考核大家对MSTP、VRRP、DHCP掌握情况,实验要求如下:
实验要求:
1.VLAN 10和vlan 20流量负载均衡;
2.SW1为vlan 10的主网关,vlan 20的备份网关;
3.SW2为vlan 20的主网关,vlan 10的备份网关;
4.DHCP服务器在vlan 66,网关在SW2上面;
5.PC1、PC2自动获取ip地址且可以互相ping通。
实验拓扑如下:
第一步,MSTP配置如下:
SW1
sysname SW1
vlan batch 10 20 66
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
stp region-configuration
region-name ntd
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
quit
stp instance 10 priority 4096
stp instance 20 priority 8192
SW2
sysname SW2
vlan batch 10 20 66
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
stp region-configuration
interface GigabitEthernet0/0/10
port link-type access
port default vlan 66
quit
region-name ntd
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
quit
stp instance 10 priority 4096
stp instance 20 priority 8192
SW3
sysname SW3
vlan batch 10 20 66
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet0/0/11
port link-type access
port default vlan 10
interface Ethernet0/0/12
port link-type access
port default vlan 20
quit
stp region-configuration
region-name ntd
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
quit
stp instance 10 priority 4096
stp instance 20 priority 8192
第二步,VRRP配置如下:
SW1
interface Vlanif10
ip address 192.168.10.251 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.250
vrrp vrid 10 priority 200
interface Vlanif20
ip address 192.168.20.251 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.20.250
SW2
interface Vlanif10
ip address 192.168.10.252 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.250
interface Vlanif20
ip address 192.168.20.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.250
vrrp vrid 10 priority 200
第三步,DHCP配置如:
SW1
dhcp enable
interface Vlanif 10
dhcp select relay
dhcp relay server-ip 192.168.66.250
interface Vlanif 20
dhcp select relay
dhcp relay server-ip 192.168.66.250
SW2
dhcp enable
interface Vlanif 10
dhcp select relay
dhcp relay server-ip 192.168.66.250
interface Vlanif 20
dhcp select relay
dhcp relay server-ip 192.168.66.250
DHCP
sysname DHCP
interface g0/0/0
ip address 192.168.66.250 24
dhcp select global
quit
ip route-static 0.0.0.0 0.0.0.0 192.168.66.252
ip route-static 0.0.0.0 0.0.0.0 192.168.66.251
ip pool p1
gateway-list 192.168.10.250
network 192.168.10.0 mask 255.255.255.0
excluded-ip-address 192.168.10.251 192.168.10.252
lease day 7 hour 0 minute 0
dns-list 8.8.8.8
ip pool p2
gateway-list 192.168.20.250
network 192.168.20.0 mask 255.255.255.0
excluded-ip-address 192.168.20.251 192.168.20.252
lease day 7 hour 0 minute 0
dns-list 8.8.8.8
最后进行验证测试:
分别在SW1和SW2上查看STP:
分别在在SW1和SW2上查看VRRP:
查看PC机IP地址获取情况如下:
均满足实验要求,配置完成!!!
转载于:https://blog.51cto.com/11806823/2407434