CCIE

2018/9/3

HSRP---CISCO私有

在SW2与SW4上配置组路由网关,在两个在PC上配置IP指向SW2/SW4的网关。对于SW2与SW4为了使PC的网关不会因为物理线路的down或是设备的损坏造成PC机的网路失效。

通过HSRP对路由网关进行组设置,使得网关线路做到冗余;

在SW2,SW4上做相同配置(优先级不同):

Switch(config-if)#standby 1 ip 192.168.10.254 //设置组网关地址
Switch#conf t
Switch(config)#int vlan 10             
Switch(config-if)#standby 1 priority 120      //设置该路由在组1中的优先级
Switch(config-if)#standby 1 timers 1 3        //设置连接时间
Switch(config-if)#standby 1 preempt           //设置路由抢占,对网关的分配
Switch(config-if)#do wr

在PC机上配置:

ip 192.168.10.1/24 192.168.10.254   //指向组网关

TRACK

当SW2与R1的线路DOWN时,如果SW2处于ACTIVE状态;那么会产生路由黑洞。

通过track监控数据包的连接情况;当TRACK的线路down时,自动将优先级降低;使STANDBY路由ACTIVE

Switch(config)#track 1 ip route 0.0.0.0 0.0.0.0 reachability 
Switch(config-if)#standby 1 ?
  authentication  Authentication
  follow          Name of HSRP group to follow
  ip              Enable HSRP IPv4 and set the virtual IP address
  ipv6            Enable HSRP IPv6
  mac-address     Virtual MAC address
  name            Redundancy name string
  preempt         Overthrow lower priority Active routers
  priority        Priority level
  timers          Hello and hold timers
  track           Priority tracking

Switch(config-if)#standby 1 track 1 ?
  decrement  Priority decrement
  shutdown   Shutdown group
  <cr>
Switch(config-if)#standby 1 track 1 decrement  50

当接口DOWN

Switch(config-if)#sh
Switch(config-if)#
*Sep  4 02:09:43.223: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to administratively down
*Sep  4 02:09:44.224: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
Switch(config-if)#do show track 
Track 1
  IP route 1.1.1.1 255.255.255.255 reachability
  Reachability is Down (no ip route)
    2 changes, last change 00:00:33
  First-hop interface is unknown
  Tracked by:
    HSRP Vlan10 1
Switch(config-if)#

猜你喜欢

转载自blog.csdn.net/qq_39524009/article/details/82352052
今日推荐