写在前面:本人是一名计算机系大二的学生,会不定时的将我的学习笔记分享给大家!如果需要更多的学习资源可以通过我的GitHub自行下载!
[RA]
#
sy
sysname RA
#
interface GigabitEthernet0/0/1
ip address 10.1.1.1 255.255.255.0
#
ospf 1 //配置ospf进行互连
a 0
net 10.1.1.0 0.0.0.255
#
[RB]
#
sy
sysname RB
#
interface GigabitEthernet0/0/2
ip address 10.1.1.2 255.255.255.0
#
ospf 1
a 0
net 10.1.1.0 0.0.0.255
#
配置二层穿透功能
[Switch]
#
sysname Switch
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port hybrid pvid vlan 100
port hybrid untagged vlan 100 //剥离tag,三层无法剥离tag
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
[RA]
#
int g0/0/1
vrrp vrid 1 virtual-ip 10.1.1.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
#
[RB]
#
interface GigabitEthernet0/0/2
vrrp vrid 1 virtual-ip 10.1.1.3
#
[RA]
#
bfd
#
bfd atob bind peer-ip 10.1.1.2 interface GigabitEthernet0/0/1
discriminator local 1
discriminator remote 2
min-tx-interval 50
min-rx-interval 50
commit
#
[RouterB]
#
bfd
#
bfd btoa bind peer-ip 10.1.1.1 interface GigabitEthernet0/0/2
discriminator remote 1
min-tx-interval 50
min-rx-interval 50
commit
#
验证状态
display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
1 2 10.1.1.2 Up S_IP_IF GigabitEthernet0/0/1
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
[RB]
#
interface g0/0/1
vrrp vrid 1 track bfd-sesion 2 increased 40
q
#
display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.3
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth Type : NONE
Virtual Mac : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2020-06-14 12:32:56
Last change time : 2020-06-14 12:33:00
display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.3
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth Type : NONE
Virtual Mac : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track BFD : 2 Priority increased : 40
BFD-Session State: UP
Create time : 2020-06-14 12:32:56
Last change time : 2020-06-14 12:32:56
模拟故障
在r1上执行shutdown命令,用display vrrp查看。
[RA]
#
int g0/0/1
shutdown
#
[RA] display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Initialize
Virtual IP : 10.1.1.3
Master IP : 0.0.0.0
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth Type : NONE
Virtual Mac : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.3
Master IP : 10.1.1.2
PriorityRun : 140
PriorityConfig : 100
MasterPriority : 140
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth Type : NONE
Virtual Mac : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track BFD : 2 Priority increased : 40 //增加40
BFD-Session State: DOWN //可以看到这里的状态是关闭的!
#
sysname RA #
bfd
#
interface GigabitEthernetg0/0/1
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
#
bfd atob bind peer-ip 10.1.1.2 interface GigabitEthernet0/0/1
discriminator local 1
discriminator remote 2
min-tx-interval 50
min-rx-interval 50
commit
#
return
#
sysname RouterB #
bfd
#
interface GigabitEthernet0/0/2
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.3
vrrp vrid 1 track bfd-session 2 increased 40
#
bfd btoa bind peer-ip 10.1.1.1 interface GigabitEthernet0/0/2
discriminator local 2
discriminator remote 1
min-tx-interval 50
min-rx-interval 50
commit
#
return
#
sysname Switch
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
interface GigabitEthernet0/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
本文均属肉肉原创,如有不详或错误,欢迎指出!
本文作者:肉肉
版权声明:博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!