(原创 转载请注明作者和出处)
基于vlan的HSRP配置
SW1
int port-channel 1
switchport mode trunk //*两个交换机使用二层etherchannel相连
int f0/1 //*作etherchannel的口
switchport mode trunk
channel-group 1 mode on
int f0/2
switchport mode trunk
channel-group 1 mode on
interface Vlan100
ip address 192.168.0.10 255.255.255.0
standby 1 ip 192.168.0.1
standby 1 priority 150 //hrsp 默认优先级是100 这里设置优先级为150
standby 1 preempt
interface Vlan200
ip address 192.168.1.10 255.255.255.0
standby 2 ip 192.168.1.1
standby 2 preempt
SW2
interface Port-channel1
switchport mode trunk
int F0/1
switchport mode trunk
channel-group 1 mode on
int F0/2
switchport mode trunk
channel-group 1 mode on
interface Vlan100
ip address 192.168.0.20 255.255.255.0
standby 1 ip 192.168.0.1
standby 1 preempt
interface Vlan200
ip address 192.168.1.20 255.255.255.0
standby 2 ip 192.168.1.1
standby 2 priority 150
standby 2 preempt