
- 1、规划 vlan 对应的mstp 实例、实例1关联vlan 111 实例2 关联110 、配置实例1 的根桥是sw3、实例2的根桥是sw4。
- 2、设置vrrp的优先级
- 3、pc5、pc7 划入vlan134
- 4、规划ospf
| 业务地点 | 业务vlan | sw3 | sw4 | 默认网关 |
| 生产办公室 | vlan110 | 10.10.110.2 | 10.10.110.3 | 10.10.110.1 |
| 质量中心 | vlan111 | 10.10.111.2 | 10.10.111.3 | 10.10.111.1 |
| 设备管理地址 | vlan132 | 10.10.132.2 | 10.10.132.3 | 10.10.132.1 |
| 本地设备 | 本地端口 | 对端设备 | 对端端口 | Vlan | Trunk |
| sw3 | g0/0/1 | sw4 | g0/0/1 | v | |
| g0/0/2 | sw2 | g0/0/2 | v | ||
| g0/0/3 | sw1 | g0/0/1 | v | ||
| g0/0/4 | sw5 | g0/0/1 | v | ||
| g0/0/5 | sw4 | g0/0/5 | v | ||
| sw4 | g0/0/1 | sw3 | g0/0/1 | v | |
| g0/0/2 | sw1 | g0/0/2 | v | ||
| g0/0/3 | sw2 | g0/0/1 | v | ||
| g0/0/4 | sw6 | g0/0/1 | v | ||
| g0/0/5 | sw3 | g0/0/5 | v | ||
| sw5 | g0/0/2 | sw6 | g0/0/2 | v |
交换机通用配置
telnet server enable
user-interface vty 0 4
protocol inbound telnet
authentication-mode password
set authentication password cipher admin@123
user privilege level 15
sw1、sw2配置
vlan batch 110 to 111 132
lldp enable
stp mode mstp
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 110 to 111 132
undo port trunk allow-pass vlan 1
unicast-suppression 30
multicast-suppression 30
broadcast-suppression 30
storm-control broadcast min-rate 5000 max-rate 8000
storm-control action block
storm-control enable trap
quit
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 110 to 111 132
undo port trunk allow-pass vlan 1
unicast-suppression 30
multicast-suppression 30
broadcast-suppression 30
storm-control broadcast min-rate 5000 max-rate 8000
storm-control action block
storm-control enable trap
quit
interface GigabitEthernet0/0/3
port link-type access
port default vlan 111
stp edge-port enable
quit
interface GigabitEthernet0/0/4
port link-type access
port default vlan 110
stp edge-port enable //不参与生成树计算,但转发bpdu报文
quit
port-group 1
group-member g0/0/5 to g0/0/24
stp edge-port enable
quit
stp region-configuration
region-name name01
instance 1 vlan 111
instance 2 vlan 110
active region-configuration
quit
路由配置sw1
interface Vlanif132
ip address 10.10.132.11 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 10.10.132.1
路由配置sw2
interface Vlanif132
ip address 10.10.132.12 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 10.10.132.1
sw3 配置
vlan batch 110 to 111 130 to 133
lldp enable
stp mode mstp
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 110 to 111 132
load-balance src-dst-mac
trunkport GigabitEthernet 0/0/1
trunkport GigabitEthernet 0/0/5
quit
port-group 1
group-member g0/0/2 to g0/0/3
port link-type trunk
port trunk allow-pass vlan 110 111 132
undo port trunk allow-pass vlan 1
quit
stp region-configuration
region-name name01
instance 1 vlan 111
instance 2 vlan 110
active region-configuration
stp instance 1 priority 0
stp instance 2 priority 4096
quit
interface Vlanif110
ip address 10.10.110.2 255.255.255.0
vrrp vrid 110 virtual-ip 10.10.110.1
vrrp vrid 110 priority 100(缺省情况下,优先级的取值是100。数值越大,优先级越高。)
quit
interface Vlanif111
ip address 10.10.111.2 255.255.255.0
vrrp vrid 111 virtual-ip 10.10.111.1
vrrp vrid 111 priority 120
quit
interface Vlanif132
ip address 10.10.132.2 255.255.255.0
vrrp vrid 132 virtual-ip 10.10.132.1
vrrp vrid 132 priority 120
quit
interface Vlanif133
ip address 10.10.133.3 255.255.255.0
ospf network-type p2p
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 132 to 135
stp disable
interface loopback0
ip address 3.3.3.3 32
ospf 100 router-id 3.3.3.3
silent-interface Vlanif110
silent-interface Vlanif111
area 0.0.0.0
network 10.10.132.0 0.0.0.255
network 10.10.133.0 0.0.0.255
network 10.10.110.0 0.0.0.255
network 10.10.111.0 0.0.0.255
sw4 配置
vlan batch 110 to 111 132 135
lldp enable
stp mode mstp
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 110 to 111 132
load-balance src-dst-mac
trunkport GigabitEthernet 0/0/1
trunkport GigabitEthernet 0/0/5
quit
port-group 1
group-member g0/0/2 to g0/0/3
port link-type trunk
port trunk allow-pass vlan 110 111 132
undo port trunk allow-pass vlan 1
quit
stp region-configuration
region-name name01
instance 1 vlan 111
instance 2 vlan 110
active region-configuration
stp instance 1 priority 4096
stp instance 2 priority 0
quit
interface Vlanif110
ip address 10.10.110.3 255.255.255.0
vrrp vrid 110 virtual-ip 10.10.110.1
vrrp vrid 110 priority 120
quit
interface Vlanif111
ip address 10.10.111.3 255.255.255.0
vrrp vrid 111 virtual-ip 10.10.111.1
vrrp vrid 111 priority 100
quit
interface Vlanif132
ip address 10.10.132.3 255.255.255.0
vrrp vrid 132 virtual-ip 10.10.132.1
vrrp vrid 132 priority 100
quit
interface Vlanif135
ip address 10.10.135.4 255.255.255.0
ospf network-type p2p
interface GigabitEthernet0/0/4
stp disable
port link-type trunk
port trunk allow-pass vlan 132 to 135
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
ospf 100 router-id 4.4.4.4
silent-interface Vlanif110
silent-interface Vlanif111
area 0.0.0.0
network 10.10.132.0 0.0.0.255
network 10.10.135.0 0.0.0.255
network 10.10.110.0 0.0.0.255
network 10.10.111.0 0.0.0.255
sw5配置
sysname sw5
vlan batch 133 to 134
undo info-center enable
interface Vlanif133
ip address 10.10.133.5 255.255.255.0
ospf network-type p2p
interface Vlanif134
ip address 10.10.134.5 255.255.255.0
ospf network-type p2p
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 132 to 135
stp disable
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 132 to 135
stp disable
interface GigabitEthernet0/0/3
port link-type access
port default vlan 134
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
ospf 100 router-id 5.5.5.5
area 0.0.0.0
network 10.10.133.0 0.0.0.255
network 10.10.134.0 0.0.0.255
sysname sw6
undo info-center enable
vlan batch 134 to 135
interface Vlanif134
ip address 10.10.134.6 255.255.255.0
ospf network-type p2p
interface Vlanif135
ip address 10.10.135.6 255.255.255.0
ospf network-type p2p
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 132 to 135
stp disable
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 132 to 135
stp disable
interface GigabitEthernet0/0/3
port link-type access
port default vlan 134
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
ospf 100 router-id 6.6.6.6
area 0.0.0.0
network 10.10.134.0 0.0.0.255
network 10.10.135.0 0.0.0.255
修改ospf 路径选择
ospf 1
nexthop 10.1.2.2 weight 1
quit