在有tunnel接口且运行动态路由协议的路由器上,
不能把公网IP地址宣告进动态路由协议。
不能把公网IP 的直连网段宣告进动态路由协议。
错点一:R1 把公网地址宣告进动态路由协议。(错误的配置)
R1
conf t
router eigrp 100
net 202.101.100.1 0.0.0.0
end
错点二:重发布直连,也就把公网地址的直连路由重发布进EIGRP 。和上面的本质是一样的
R1
router eigrp 100
redistribute connected metric 10000 100 255 1 1500
end 发现邻居up & down。
R1 !!! 即使把这条静态路由写下去也不能解决问题。
conf t
ip route 202.101.200.0 255.255.255.252 202.101.100.2
end
Tunnel 配置:
R1
conf t
int tunnel 0
tunnel source f0/0
tunnel destination 202.101.200.1
tunnel mode gre ip
ip add 172.16.12.1 255.255.255.0
no sh
end
R2
conf t
int tunnel 0
tunnel source f0/0
tunnel destination 202.101.100.1
tunnel mode gre ip
ip add 172.16.12.2 255.255.255.0
no sh
end
!
运行EIGRP :
R1
conf t
router eigrp 100
no auto-summary
net 172.16.12.1 0.0.0.0
net 1.1.1.1 0.0.0.0
end
R2
conf t
router eigrp 100
no auto-summary
net 172.16.12.2 0.0.0.0
net 2.2.2.2 0.0.0.0
end
IP地址配置:
R1
conf t
int f0/0
ip add 202.101.100.1 255.255.255.252
no sh
exit
int lo0
ip add 1.1.1.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 202.101.100.2
end
!
Internet
conf t
int f0/0
ip add 202.101.100.2 255.255.255.252
no sh
int f0/1
ip add 202.101.200.2 255.255.255.252
no sh
int lo0
ip add 8.8.8.8 255.255.255.0
no sh
end
R2
conf t
int f0/0
ip add 202.101.200.1 255.255.255.0
no sh
int lo0
ip add 2.2.2.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 202.101.200.2
end
重要区别:
(1)没有去往源IP 路由是这样显示的: * * *
(2)没有去往目的IP 路由是这样显示的:!H !H !H
步骤一:IP 地址配置
R1
conf t
int e0/0
no sh
ip add 10.1.12.1 255.255.255.0
!
int lo0
ip add 1.1.1.1 255.255.255.255
no sh
end
!
R2
conf t
int e0/0
no sh
ip add 10.1.12.2 255.255.255.0
!
int e0/1
no sh
ip add 10.1.23.2 255.255.255.0
end
!
R3
conf t
int e0/0
no sh
ip add 10.1.23.3 255.255.255.0
!
int e0/1
no sh
ip add 10.1.34.3 255.255.255.0
end
R4
conf t
int e0/0
no sh
ip add 10.1.34.4 255.255.255.0
!
int lo0
ip add 4.4.4.4 255.255.255.255
no sh
end
步骤二:路由配置
(1) R1 有去往4.4.4.4 的路由,也有1.1.1.1 的直连路由
R1
conf t
ip route 4.4.4.4 255.255.255.255 10.1.12.2
end
!
(2) R2 有去往4.4.4.4 的路由,但是没有去往1.1.1.1 的路由
R2
conf t
ip route 4.4.4.4 255.255.255.255 10.1.23.3
end
(3) R3 有去往1.1.1.1 的路由,但是没有去往4.4.4.4 的路由
R3
conf t
ip route 1.1.1.1 255.255.255.255 10.1.23.2
end
(4) R4 有去往1.1.1.1 的路由,也有4.4.4.4 的直连路由
R4
conf t
ip route 1.1.1.1 255.255.255.255 10.1.34.3
end
!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. 实验测试1:
(1)发现数据没能到达R2
(2)因为R2 没有去往 1.1.1.1 的路由:(去往源IP 的路由)
(3)此时给R2 配置 去往1.1.1.1/32 的路由
R2
conf t
ip route 1.1.1.1 255.255.255.255 10.1.12.1
end
!
2. 实验测试2:
(1) 发现数据没能到达R3
(2) 因为R3 没有到达目的IP 的路由器,没有4.4.4.4/32 的路由
(3) 给R3 配置去往目的IP 4.4.4.4 的静态路由
R3
conf t
ip route 4.4.4.4 255.255.255.255 10.1.34.4
end
!
此时traceroute 就没问题了: