双核心HSRP配置案例.docx

上传人:b****5 文档编号:8632260 上传时间:2023-02-01 格式:DOCX 页数:8 大小:25.76KB
下载 相关 举报
双核心HSRP配置案例.docx_第1页
第1页 / 共8页
双核心HSRP配置案例.docx_第2页
第2页 / 共8页
双核心HSRP配置案例.docx_第3页
第3页 / 共8页
双核心HSRP配置案例.docx_第4页
第4页 / 共8页
双核心HSRP配置案例.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

双核心HSRP配置案例.docx

《双核心HSRP配置案例.docx》由会员分享,可在线阅读,更多相关《双核心HSRP配置案例.docx(8页珍藏版)》请在冰豆网上搜索。

双核心HSRP配置案例.docx

双核心HSRP配置案例

发表于 2011-4-1718:

33 | 来自 51CTO网页

[只看他]7#

20110415_d7f9964633cd6c487ceeNTF8mcN27CXh.jpg(45.01KB)

2011-4-1718:

33

1交换机之间进行连接,使用Trunk模式,以便于相同vlan在不同交换机上通信和配置vtp域,减少vlan的配置,易于管理

SW1

-----------------------------

intg0/1

switchportmodedynamicdesirable  //端口采用动态期望模式,即主动模式,如果对端端口同样是动态期望或者Trunk模式的话,则工作模式都为Trunk模式

exit

intg0/2

switchportmodedynamicdesirable  

exit

intg0/3

switchportmodedynamicdesirable  

exit

intg0/4

switchportmodedynamicdesirable  

exit

intg0/5

switchportmodedynamicdesirable  

exit

//showintg0/1switchport检查端口是否为Trunk模式

------------------------------------------

SW2

intg0/1

switchportmodedynamicdesirable  

exit

intg0/2

switchportmodedynamicdesirable  

exit

intg0/3

switchportmodedynamicdesirable  

exit

intg0/4

switchportmodedynamicdesirable  

exit

intg0/5

switchportmodedynamicdesirable  

exit

---------------------------------

SW3

intrangeg0/1-4

switchportmodetrunk

exit

--------------------------------

SW4

intrangeg0/1-4

switchportmodetrunk

exit

--------------------------------------

SW5

intg0/3

switchportmodetrunk

exit

--------------------------------------

SW6

intg0/4

switchportmodetrunk

exit

--------------------------------------

SW7

intg0/3

switchportmodetrunk

exit

--------------------------------------

SW8

intg0/4

switchportmodetrunk

exit

-------------------------------------------------------------------------------------------

2端口Trunk之后,配置vtp域,并开启vtp修剪,减少不必要的广播流量,也可以直接进入Trunk模式的端口模式,对从被端口允许通过的vlan进行限制.

//intg0/1

//switchporttrunkallowedvlanremove1//1是vlan号,默认是允许所有vlan的数据通过

-----------------------------------

SW1

在全局配置模式下

vtpdomaincisco//配置vtp域名

vtpmodeserver//设置vtp模式为服务器模式,还可以设置vtp域的密码.可选,设置的话,只有其它交换机上也设置了密码,并正确的话,才能同步学习到vlan的配置.

vtppruning

-----------------------------------

SW2

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW3

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW4

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW5

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW6

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW7

vtpdomaincisco

vtpmodeclient

vtppruning

-----------------------------------

SW8

vtpdomaincisco

vtpmodeclient

vtppruning

-------------------------------------------------------------------------

3在vtp模式为服务器模式的交换机上创建vlan

SW1

-------------------------

全局模式

vlan2

vlan3

退出//可以设置vlan的名字

之后,加入到vtp域中的其它交换机就会学习到vlan

如果有多个vlan的话,做vtp域非常方便.

4  如果接入层的交换机连接如PC,需要对pc进行管理的话,可以将pc所连接的端口加入vlan

--------------------------------------------------------------------------------------------------------

5在三层交换机上开启路由功能,并设置vlan的三层接口地址(即该vlan的真实网关地址),让不同vlan之间互相通信

---------------------------

SW1

全局模式

iprouting//开启路由功能

intvlan2

ip  address192.168.2.1255.255.255.0

noshutdown

exit

intvlan3

ip  address192.168.3.1255.255.255.0

noshutdown

exit

---------------------------

SW2

全局模式

iprouting//开启路由功能

//为了实现负载均衡和热备份,需要在每个三层交换机上配置vlan的三层接口地址

intvlan2

ip  address192.168.2.2255.255.255.0

noshutdown

exit

intvlan3

ip  address192.168.3.2255.255.255.0

noshutdown

exit

----------------------------------------------------------------------------------

6  用RSTP来实现vlan的数据分流,和负载均衡

//使用RSTP可以提高交换机之间运行RSTP协议时的收敛速度,它要比stp的收敛速度快很多.

--------------------------------------------

SW1(核心交换机)

全局模式

spanning-treemoderapid-pvst  //将生成树模式改为RSTP。

spanning-treevlan2priority4096  //设置本地交换机,SW1成为vlan2的根网桥,让vlan2的数据从SW1转发.经过是rstp算法之后,确定出根网桥,根端口,指定端口,替代端口,备用端口之后,当网络中根端口或者指定端口的链路出现故障后,启用替代端口,或备用端口.实现链路冗余.

exit

showspanning-treevlan2  //查看vlan2的生成树配置

--------------------------------------------

SW2(核心交换机)

全局模式

spanning-treemoderapid-pvst  

spanning-treevlan3priority4096  

exit

showspanning-treevlan3 

---------------------------------------------------------------------------------------

7设置HSRP

------------------------

SW1

intvlan2

stanbdy2ip192.168.2.254  //设置HSRP组号,并设置虚拟路由器的ip地址(该地址是vlan2的虚拟网关IP地址)

stanbdy2times28  //设置Hello时间为2秒,Hold时间为8秒

standby2priority200  //设置本交换机在HSRP组的优先级为200,使交换机成为vlan2的活跃路由器

standby2trackG0/6  60//设置端口跟踪,当G0/6的端口出现故障时,降低交换机的优先级,vlan2的数据从SW2转发

intvlan3

standby3ip192.168.3.254

standby3times28

standby3priority150  //设置在HSRP组3中的优先级为150,让SW2成为vlan3的活跃路由器,让数据从sw2转发

-------------------------------

SW2

intvlan2

stanbdy2ip192.168.2.254  

stanbdy2times28  

standby2priority150  //设置本交换机在hSRP组的优先级为150,使本交换机成为vlan2的备份路由器

intvlan3

standby3ip192.168.3.254

standby3times28

standby3priority200//设置本交换机在hSRP组的优先级为200,使本交换机成为vlan3的活跃路由器

standby2trackG0/6  60//设置端口跟踪,当G0/6的端口出现故障时,降低交换机的优先级,vlan3的数据从SW1转发

//这样就实现了sw1为vlan2的活跃路由器,sw2为vlan2的备份路由器,sw2为vlan3的活跃路由器,sw1为vlan3的备份路由器,让vlan2的数据从sw1转发,vlan3的数据从sw2转发,当sw1出现故障时,vlan2的数据从sw2转发,vlan3同样也是如此,并且配置在网络层的HSRP和在设置的rstp生成树配置,在数据链路层让vlan2数据从sw1转发,vlan3的数据从sw2转发,要一致

//另外配置完HSRP之后,用showstandbybrief查看HSRP配置信息,如果sw1没有成为vlan2的活跃路由器,而成为备份路由器,或者sw2没有成为vlan3的活跃路由器,而成为备份路由器,可能是因为,将交换机加入HSRP组的时间问题,较早加入HSRP组的交换机默认成为本组的活跃路由器,并不考虑优先级的问题.

可以通过配置占先权让优先级高的交换机成为活跃路由器.在要将其设置为活跃路由器的vlan哩,用standbynumber(组号)preempt配置占先权,让其成为本vlan的活跃路由器.

-----------------------------------------------------------------------------------------------------------

8  在三层交换机上设置默认路由,让内网用户与外网进行通信,只需要设置默认路由就可以,并不需要考虑要到达的网段是什么,将其交给它的下一条也就是路由器的两个接口进行数据转发,

--------------------------

SW1

全局模式

intg0/6

noswitchport//三层交换机与路由器连接,并设置路由的话,需要将其与路由器连接的接口设置为路由接口

ipaddress10.1.1.2255.255.255.252  //给接口配置地址,使用子网掩码为30的网段进行设备互联.

noshutdown

exit

iproute0.0.0.00.0.0.010.1.1.1  //配置默认路由,指定下一跳地址为10.1.1.1也就是路由器的g0/1端口

---------------------------

sw2

intg0/6

nopswitchport

ipadd10.1.1.6255.255.255.252

noshutdown

exit

iproute0.0.0.00.0.0.010.1.1.5//配置默认路由,指定下一跳地址为10.1.1.5也就是路由器的g0/2端口

-----------------------------------------------------------------------------------------------------------------

9配置路由器的接口地址,并设置到达内网的路由,将路由设置为浮动静态路由,正常情况下,外网到达vlan2192.168.2.0网段的数据从sw1交换机转发,当路由器和sw1之间的链路出现故障时,数据从sw2转发,vlan3192.168.3.0网段同样也是如此.这样整个负载均衡就做完了.

--------------------------------------------------

R1

全局模式

intg0/1

ipaddress10.1.1.1255.255.255.252

noshutdown

exit

intg0/2

ipaddress10.1.1.5255.255.255.252

noshutdown

exit

iproute192.168.2.0255.255.255.010.1.1.2

iproute192.168.2.0255.255.255.010.1.1.650//设置浮动静态路由的管理距离,也就是优先级为50,静态路由没有设置的管理距离默认是1,当管理距离为1的路由down后,启动管理距离为50的路由

iproute192.168.3.0255.255.255.010.1.1.6

iproute192.168.3.0255.255.255.010.1.1.250

exit

shiproute

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1