1、HDLC的IP接口复用小实验
要求:
1、R1和R2上各有一个环回地址;
2、R1和R2都复用换回地址的IP;
配置环回地址
R1
[r1]int l0
[r1-LoopBack0]ip address 12.0.0.1 24
R2
[r2]int l0
[r2-LoopBack0]ip address 11.0.0.1 24
配置链路链接
R1
[r1-Serial1/0/0]link-protocol hdlc
R2
[r2-Serial1/0/0]link-protocol hdlc
配置接口复用
R1
[r1-Serial1/0/0]ip address unnumbered interface LoopBack 0
R2
[r2-Serial1/0/0]ip address unnumbered interface LoopBack 0
补充路由信息
R1
[r1]ip route-static 12.0.0.0 24 Serial 1/0/0
R2
[r1]ip route-static 11.0.0.0 24 Serial 1/0/0
2、静态路由和BFD连用
要求:
1、R3配置到10.9.9.0/24的浮动路由
2、在R2配置BFD
配置接口IP
R1
[r1-GigabitEthernet0/0/0] ip address 10.1.23.2 255.255.255.0
[r1]interface LoopBack 0
[r1-LoopBack0] ip address 10.9.9.1 255.255.255.0
R2
[r2-GigabitEthernet0/0/0] ip address 10.1.134.2 255.255.255.0
[r2-GigabitEthernet0/0/1] ip address 10.1.23.1 255.255.255.0
R3
[r3-GigabitEthernet0/0/0] ip address 10.1.23.2 255.255.255.0
[r3-GigabitEthernet0/0/1] ip address 10.1.34.2 255.255.255.0
R4
[r4-GigabitEthernet0/0/0] ip address 10.1.34.1 255.255.255.0
[r4-GigabitEthernet0/0/1] ip address 10.1.134.4 255.255.255.0
配置路由信息
R1
[r1]ip route-static 10.1.23.0 255.255.255.0 10.1.134.2
[r1]ip route-static 10.1.34.0 255.255.255.0 10.1.134.4
R2
[r2]ip route-static 10.1.34.0 255.255.255.0 10.1.134.4
[r2]ip route-static 10.1.34.0 255.255.255.0 10.1.23.2
[r2]ip route-static 10.9.9.0 255.255.255.0 10.1.134.1
R3
[r3]ip route-static 10.1.134.0 255.255.255.0 10.1.23.1
[r3]ip route-static 10.1.134.0 255.255.255.0 10.1.34.1
[r3]ip route-static 10.9.9.0 255.255.255.0 10.1.34.1 preference 61
R4
[r4]ip route-static 10.1.23.0 255.255.255.0 10.1.134.2
[r4]ip route-static 10.1.23.0 255.255.255.0 10.1.34.2
[r4]ip route-static 10.9.9.0 255.255.255.0 10.1.134.1
配置BDF
[r1]bfd
[r1]bfd aa bind peer-ip 10.1.23.1
[r1-bfd-session-aa]discriminator local 10
[r1-bfd-session-aa]discriminator remote 20
[r1-bfd-session-aa]commit
[r2]bfd
[r2]bfd bb bind peer-ip 10.1.23.2
[r2-bfd-session-bb]discriminator local 20
[r2-bfd-session-bb]discriminator remote 10
[r2-bfd-session-bb]commit
[r1]ip route-static 10.9.9.0 24 10.1.23.1 track bfd-session aa
测试:
<r3>ping 10.9.9.1
PING 10.9.9.1: 56 data bytes, press CTRL_C to break
Request time out
Reply from 10.9.9.1: bytes=56 Sequence=2 ttl=254 time=120 ms
Reply from 10.9.9.1: bytes=56 Sequence=3 ttl=254 time=80 ms
Reply from 10.9.9.1: bytes=56 Sequence=4 ttl=254 time=90 ms
Reply from 10.9.9.1: bytes=56 Sequence=5 ttl=254 time=90 ms
--- 10.9.9.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 80/95/120 ms
[r2-GigabitEthernet0/0/0]shutdown
[r3]ping 10.9.9.1
PING 10.9.9.1: 56 data bytes, press CTRL_C to break
Reply from 10.9.9.1: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 10.9.9.1: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 10.9.9.1: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 10.9.9.1: bytes=56 Sequence=4 ttl=254 time=40 ms
Reply from 10.9.9.1: bytes=56 Sequence=5 ttl=254 time=60 ms
--- 10.9.9.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/52/60 ms
附上两张路由表
断开前
断开后