三层交换机:
1.三层交换机=三层路由+二层交换机
2.三层路由引擎是可以关闭或开启的
conf t
ip routing 开启三层路由功能
no ip routing 关闭三层路由功能
3.三层交换机的优点:
解决了网络瓶颈问题
解决了单点故障(虚拟接口不再依赖任何的物理接口)
一次路由,永久交换
命令
ip routing 开启三层路由
int vlan 10
ip add 10.1.1.254
no shut
int vlan 20
ip add 20.1.1.254
no shut
交换机的表
CEF表 邻接关系表
vlan 20.1.1.1 —— BB CC
二层端口升级为三层端口
int f0/x
no switchport
ip add xx.xx.xx.xx
HSRP
热备份路由协议
1.HSRP组号:1-255,没有大小之分
2.虚拟路由器的IP称为虚拟IP地址
3.HSRP组的成员:
1.虚拟路由器(老大)
2.活跃路由器
3.备份路由器
4.其他路由器
4.HSRP优先级:1-255,默认为100
5.HSRP组成员通过定时发送hello包来交流,默认每隔3秒
hello时间3秒,坚持时间10秒
6.占先权
作用:当检测不到对方,或检测到对方的优先级比自己低,
立即抢占活跃路由的名分
7.配置跟踪track
跟踪外网端口状态,当外网down掉,则自降优先级
命令
R1
int f0/0
standby 1 ip 192.168.1.252
standby 1 priority 200
standby 1 preempt
standby 1 track f0/1
exit
R2
int f0/0
standby 1 ip 192.168.1.252
standby 1 priority 195
standby 1 preempt
standby 1 track f0/1
exit
查看hrsp状态:
show standby br
show standby