一、实验需求
1、按照图示VLAN及IP地址需求,完成相关配置
2、要求SW1为VLAN2/3 的主根及主网关,SW2为VLAN20/30的主根及主网关,SW1和SW2互为备份
3、可以使用super vlan
4、上层通过静态路由协议完成通讯过程
5、AR1为企业出口路由器
6、要求全网可达
二、实验步骤
1、划分二层sw1 sw2 sw3 sw4的vlan
基本命令
vlan batch 2 3 20 30
port link-type access
port link-type trunk
port trunk allowpass vlan 2 3 20 30
2、配置生成树协议(sw1 sw2 sw3 sw4)
1、让sw1、sw2、sw3、sw4四台设备认知stp基本内容
基本命令:
stp enable
stp mode mstp
stp region-configuration
region-name aa
revision-level 100
instance 1 vlan 2 to 3
instance 2 vlan 20 30
active region-configuration
2、更改sw1的桥优先级
stp instance 1 root primary
stp instance 2 root secondary
3、更改sw2的桥优先级
stp instance 1 root secondary
stp instance 2 root primary
4、开启sw1根保护
int g 0/0/3
stp root-protection
5、边缘端口
进入端口
stp edged-port enable
3、配置网关
SW1
主网关:
interface Vlanif2
ip address 10.0.2.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.0.2.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30
interface Vlanif3
ip address 10.0.3.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.0.3.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30
副网关:
interface Vlanif 20
ip address 10.0.20.1 24
vrrp vrid 1 virtual-ip 10.0.20.254
int v 30
ip address 10.0.30.1 24
vrrp vrid 1 virtual-ip 10.0.30.254
SW2和SW1相反
4、配置DHCP
sw1:
ip pool vlan2
gateway-list 10.0.2.254
network 10.0.2.0 mask 255.255.255.0
dns-list 8.8.8.8
sw2同配置
排除IP
sw1:
undo network
undo gateway-list 10.0.2.254
network 10.0.2.0 mask 25
gateway-list 10.0.2.100
sw2:
undo network
network 10.0.2.128 mask 25
5、配置pc IP并测试
6、创建互联vlan
sw1:
vlan 11
int g 0/0/5
port link-type access
port default vlan 11
interface Vlanif 11
ip address 10.0.11.1 30
sw2:
vlan 12
int g 0/0/5
port link-type access
port default vlan 12
interface Vlanif 12
ip address 10.0.11.2 30
AR1:
int g 0/0/1
ip address 10.0.11.2 30
int g 0/0/2
ip address 10.0.12.2 30
7、动态路由协议
sw1:
ospf 1
area 0
network宣告下列IP
Vlanif2 10.0.2.1/24 up up
Vlanif3 10.0.3.1/24 up up
Vlanif11 10.0.11.1/30 up up
Vlanif20 10.0.20.1/24 up up
Vlanif30 10.0.30.1/24 up up
sw2原理相同
AR1只需宣告10.0.11.2 10.0.12.2
静默接口(sw1 sw2
silent-interface Vlanif 2
silent-interface Vlanif 3
silent-interface Vlanif 20
silent-interface Vlanif 30
sw1和sw2之间也要创建vlan
vlan 13
interface Eth-Trunk 0
port trunk allow-pass vlan 13