我是靠谱客的博主 含蓄树叶,最近开发中收集的这篇文章主要介绍ENSP:VRRP+MSTP+DHCP配置,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

PC端的IP地址由AR1分配,在LSW1和 LSW2使用链路聚合和虚拟冗余,在LSW1-LSW8使用多生成树。VLAN 10 、 VLAN30 映射到instance 实例 1 ,VLAN 20 、VLAN40 映射到instance 实例2。LSW1为主根桥,LSW2为备份根桥。在LSW1中,实例1为主根,实例2为从根。在LSW2中,实例1从根,实例2为主根。

LSW5

#
vlan batch 10

interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10

LSW6-LSW8与LSW5配置大致相同,只是VLAN划分不同。

#

LSW3
vlan batch 10 20
#
stp region-configuration
 region-name DC
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 

LSW4

#
vlan batch 30 40
#
stp region-configuration
 region-name DC
 instance 1 vlan 30
 instance 2 vlan 40
 active region-configuration
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
 

LSW1

#
dhcp enable
#
vlan batch 10 20 30 40 101
#
stp instance 0 root primary (不需要打,它自动生成的,无影响)
stp instance 1 root primary
stp instance 2 root secondary
#
stp region-configuration
 region-name DC
 instance 1 vlan 10 30
 instance 2 vlan 20 40
 active region-configuration
#
interface Vlanif10
 ip address 192.168.10.253 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
 vrrp vrid 10 priority 120
 dhcp select relay
 dhcp relay server-ip 192.168.101.2
#
interface Vlanif20
 ip address 192.168.20.253 255.255.255.0
 vrrp vrid 20 virtual-ip 192.168.20.254
 dhcp select relay
 dhcp relay server-ip 192.168.101.2
#
interface Vlanif30
 ip address 192.168.30.253 255.255.255.0
 vrrp vrid 30 virtual-ip 192.168.30.254
 vrrp vrid 30 priority 120
 dhcp select relay
 dhcp relay server-ip 192.168.101.2
#
interface Vlanif40
 ip address 192.168.40.253 255.255.255.0
 vrrp vrid 40 virtual-ip 192.168.40.254
 dhcp select relay
 dhcp relay server-ip 192.168.101.2
#
interface Vlanif101
 ip address 192.168.101.1 255.255.255.0

#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 101
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 1
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
ip route-static 0.0.0.0 0.0.0.0 192.168.101.2   

LSW2


vlan batch 10 20 30 40 102
#
stp instance 0 root secondary(不需要打,它自动生成的,无影响)
stp instance 1 root secondary
stp instance 2 root primary

#
dhcp enable
#
stp region-configuration
 region-name DC
 instance 1 vlan 10 30
 instance 2 vlan 20 40
 active region-configuration
#

interface Vlanif10
 ip address 192.168.10.253 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
 dhcp select relay
 dhcp relay server-ip 192.168.102.2
#
interface Vlanif20
 ip address 192.168.20.253 255.255.255.0
 vrrp vrid 20 virtual-ip 192.168.20.254
 vrrp vrid 20 priority 120
 dhcp select relay
 dhcp relay server-ip 192.168.102.2
#
interface Vlanif30
 ip address 192.168.30.253 255.255.255.0
 vrrp vrid 30 virtual-ip 192.168.30.254
 dhcp select relay
 dhcp relay server-ip 192.168.102.2
#
interface Vlanif40
 ip address 192.168.40.253 255.255.255.0
 vrrp vrid 40 virtual-ip 192.168.40.254
 vrrp vrid 40 priority 120
 dhcp select relay
 dhcp relay server-ip 192.168.102.2
#
interface Vlanif102
 ip address 192.168.102.1 255.255.255.0
#

interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 102
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 1
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

#
ip route-static 0.0.0.0 0.0.0.0 192.168.102.2
#
 

AR1

#
dhcp enable
#
ip pool vlan10
 gateway-list 192.168.10.254 
 network 192.168.10.0 mask 255.255.255.0 
 excluded-ip-address 192.168.10.252 192.168.10.253 
 dns-list 8.8.8.8 
#
ip pool vlan20
 gateway-list 192.168.20.254 
 network 192.168.20.0 mask 255.255.255.0 
 excluded-ip-address 192.168.20.252 192.168.20.253 
 dns-list 8.8.8.8 
#
ip pool vlan30
 gateway-list 192.168.30.254 
 network 192.168.30.0 mask 255.255.255.0 
 excluded-ip-address 192.168.30.252 192.168.30.253 
 dns-list 8.8.8.8 
#
ip pool vlan40
 gateway-list 192.168.40.254 
 network 192.168.40.0 mask 255.255.255.0 
 excluded-ip-address 192.168.40.252 192.168.40.253 
 dns-list 8.8.8.8 
#
interface GigabitEthernet0/0/0
 ip address 192.168.101.2 255.255.255.0 
 dhcp select global
#
interface GigabitEthernet0/0/1
 ip address 192.168.102.2 255.255.255.0 
 dhcp select global
#

ip route-static 192.168.10.0 255.255.255.0 192.168.101.1
ip route-static 192.168.10.0 255.255.255.0 192.168.102.1
ip route-static 192.168.20.0 255.255.255.0 192.168.101.1
ip route-static 192.168.20.0 255.255.255.0 192.168.102.1
ip route-static 192.168.30.0 255.255.255.0 192.168.101.1
ip route-static 192.168.30.0 255.255.255.0 192.168.102.1
ip route-static 192.168.40.0 255.255.255.0 192.168.101.1
ip route-static 192.168.40.0 255.255.255.0 192.168.102.1
#

PC1

 

 PC1 PING PC2

在LSW6 E0/0/0处抓包

 PC1  PING  AR1 

 小白一个!

最后

以上就是含蓄树叶为你收集整理的ENSP:VRRP+MSTP+DHCP配置的全部内容,希望文章能够帮你解决ENSP:VRRP+MSTP+DHCP配置所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部