vlan+vrrp+ stp

简介:

拓扑图:

wKiom1llhrzzVxtbAADqT3q7mMc438.png

配置代码:

sw1------------

sys

vlan 10

vlan 20

quit

 

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/3

port link-type trunk

port trunk allow-pass vlan all

int e0/0/4

port link-type trunk

port trunk allow-pass vlan all

quit

 

(每个交换机都配)

stp region-configuration

region-name fxl

revision-level 1

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

 

sw2--------------

sys

vlan 10

vlan 20

quit

 

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/3

port link-type trunk

port trunk allow-pass vlan all

int e0/0/4

port link-type trunk

port trunk allow-pass vlan all

quit

 

stp region-configuration

region-name fxl

revision-level 1

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

 

sw3--------------

sys

vlan 10

vlan 20

quit

 

g0/0/3g0/0/4端口聚合)

interface eth-trunk 1

quit

interface g0/0/3

eth-trunk 1

quit

interface g0/0/4

eth-trunk 1

quit

interface eth-trunk 1

port link-type trunk

port trunk allow-pass vlan all

quit

 

int g0/0/1

port link-type trunk

port trunk allow-pass vlan all

int g0/0/2

port link-type trunk

port trunk allow-pass vlan all

quit

 

stp region-configuration

region-name fxl

revision-level 1

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

stp instance 1 priority 4096(配置stp使sw3成为vlan10的根)

 

 

(配置g0/0/5ip)

vlan 100

int vlanif 100

ip add 10.0.0.1 24

int g0/0/5

port link-type access

port default vlan 100

quit

 

(配置vrrp 使sw4down掉时数据可从sw3通过)

int vlanif 10(与sw4中的vlan10对比)

ip add 192.168.10.252 24

vrrp vrid 1 virtual-ip 192.168.10.254sw3sw4都配这虚拟ip

vrrp vrid 1 priority 200(数据从优先级大的通过)

vrrp vrid 1 track interface g0/0/5 reduced 150

(配置端口追踪,当g0/0/5down掉时将vrid 优先级减150

quit

 

int vlanif 20(与sw4中的vlan20对比)

ip add 192.168.20.252 24

vrrp vrid 2 virtual-ip 192.168.20.254

vrrp vrid 2 priority 150

quit

 

rip

version 2

network 192.168.10.0

network 192.168.20.0

network 10.0.0.0

quit

 

sw4--------------

sys

vlan 10

vlan 20

quit

 

g0/0/3g0/0/4端口聚合)

interface eth-trunk 1

quit

interface g0/0/3

eth-trunk 1

quit

interface g0/0/4

eth-trunk 1

quit

interface eth-trunk 1

port link-type trunk

port trunk allow-pass vlan all

quit

 

int g0/0/1

port link-type trunk

port trunk allow-pass vlan all

int g0/0/2

port link-type trunk

port trunk allow-pass vlan all

quit

 

(配置stp使sw4成为vlan20的根)

stp region-configuration

region-name fxl

revision-level 1

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

stp instance 2 priority 4096

 

 

(配置g0/0/5ip)

vlan 200

int vlanif 200

ip add 20.0.0.1 24

int g0/0/5

port link-type access

port default vlan 200

quit

 

int vlanif 10

ip add 192.168.10.253 24

vrrp vrid 1 virtual-ip 192.168.10.254

vrrp vrid 1 priority 150

quit

 

(配置vrrp 使sw4down掉时数据可从sw3通过)

int vlanif 20

ip add 192.168.20.253 24

vrrp vrid 2 virtual-ip 192.168.20.254

vrrp vrid 2 priority 200

vrrp vrid 2 track interface g0/0/5 reduced 150

quit

 

rip

version 2

network 192.168.10.0

network 192.168.20.0

network 20.0.0.0

quit

 

 

R1---------

sys

int g0/0/0

ip add 10.0.0.2 24

int g0/0/1

ip add 20.0.0.2 24

int g0/0/2

ip add 30.0.0.254 24

quit

 

rip

version 2

network 10.0.0.0

network 20.0.0.0

network 30.0.0.0

quit

验证:

wKioL1llhrzA6bVUAABQMgIpRss137.png

wKiom1llhr2hdgeVAABSHDf2PUg677.png

vlan10sw3通过

wKioL1llhr6D5HWuAACZo7syye4633.png

Vlan20从sw4通过

wKiom1llhr_AkiO7AABajfcjn1k695.png

sw4down掉后:vlan20数据从sw3通过:

wKioL1llhr_BBXV2AABjGrPjxUI019.png

验证端口追踪:

sw4端口g0/0/5down掉后:vlan20数据从sw3通过:

wKiom1llhsDjRLU8AABknZvwOUQ693.png



本文转自 fxl风 51CTO博客,原文链接:http://blog.51cto.com/fengxiaoli/1946545

相关文章
|
网络架构
交换机与路由器技术-11-VLAN Trunk
交换机与路由器技术-11-VLAN Trunk
68 0
|
安全 网络性能优化 网络虚拟化
本征vlan与关于本征
本征VLAN(Native Vlan)分配给802.Q中继端口支持来自多个VLAN的流量(有标记流量),也支持来自VLAN以外的流量(无标记流量)。802.1Q中继端口会将无标记流量发送到本征VLAN。如果交换机端口配置了本征VLAN,则连接到该端口的计算机将产生无标记流量。本征VLAN在IEEE 802.1Q规范中说明,其作用是向下兼容传统LAN方案中的无标记流量。对我们来说,本征VLAN的目的是充当中继链路两端的公共标识。最佳做法是使用VLAN 1 以外作为本征VLAN。
430 0
本征vlan与关于本征
|
网络虚拟化 网络架构 数据安全/隐私保护
|
网络虚拟化
|
网络虚拟化
|
网络虚拟化
|
网络虚拟化
|
网络虚拟化
|
网络虚拟化