这个实验是为了说明当某个区域配置为
NSSA
区域时,正如这个图所示的情况,当
EIGRP
被重分布到
OSPF
网络时,
NSSA
区域内的路由器(除了
ABR
路由器外)是无法学习到此外部路由信息的。必须手动配置一条默认路由,引导路由器访问外部网络
具体配置如下:
R1:
interface Loopback0
ip address 172.16.0.1 255.255.255.0
!
interface Loopback1
ip address 172.16.1.1 255.255.255.0
!
interface Loopback2
ip address 172.16.2.1 255.255.255.0
!
interface Loopback3
ip address 172.16.3.1 255.255.255.0
!
interface Serial0/0
ip address 192.168.1.1 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
clock rate 64000
!
router ospf 1
log-adjacency-changes
area 1 nssa
redistribute rip metric 50 subnets
!
router rip
version 2
network 172.16.0.0
no auto-summary
R2:
interface Serial0/0
ip address 192.168.2.2 255.255.255.0
ip ospf 1 area 0
serial restart-delay 0
clock rate 64000
!
interface Serial0/1
ip address 192.168.1.2 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
area 1 nssa
!
R3:
interface Serial0/0
ip address 192.168.3.3 255.255.255.0
ip ospf 1 area 2
serial restart-delay 0
clock rate 64000
!
interface Serial0/1
ip address 192.168.2.3 255.255.255.0
ip ospf 1 area 0
serial restart-delay 0
!!
router ospf 1
log-adjacency-changes
R4:
interface Loopback0
ip address 10.1.0 .1 255.255.255.0
!
interface Loopback1
ip address 10.1.1 .1 255.255.255.0
!
interface Loopback2
ip address 10.1.2 .1 255.255.255.0
!
interface Loopback3
ip address 10.1.3 .1 255.255.255.0
!
interface Serial0/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/1
ip address 192.168.3.4 255.255.255.0
ip ospf 1 area 2
serial restart-delay 0
!
router eigrp 1
network 10.0.0 .0
auto-summary
!
router ospf 1
log-adjacency-changes
redistribute eigrp 1 metric 50 subnets
按上面配置完成后,我们来看看
R1
上的路由表
r1(config-if)#do sh ip rou
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
C 192.168.1.0/24 is directly connected, Serial0/0
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:01:07, Serial0/0
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:00:47, Serial0/0
果然没有重分发
EIGRP
后的路由信息。
再来看看
R2
上的路由条目
r2(config-if)#do sh ip rou
172.16.0.0/24 is subnetted, 4 subnets
O N2 172.16.0.0 [110/50] via 192.168.1.1, 00:00:41, Serial0/1
O N2 172.16.1.0 [110/50] via 192.168.1.1, 00:00:41, Serial0/1
O N2 172.16.2.0 [110/50] via 192.168.1.1, 00:00:41, Serial0/1
O N2 172.16.3.0 [110/50] via 192.168.1.1, 00:00:41, Serial0/1
10.0.0 .0/24 is subnetted, 4 subnets
O E2 10.1.3 .0 [110/50] via 192.168.2.3, 00:00:41, Serial0/0
O E2 10.1.2 .0 [110/50] via 192.168.2.3, 00:00:41, Serial0/0
O E2 10.1.1 .0 [110/50] via 192.168.2.3, 00:00:41, Serial0/0
O E2 10.1.0 .0 [110/50] via 192.168.2.3, 00:00:41, Serial0/0
C 192.168.1.0/24 is directly connected, Serial0/1
C 192.168.2.0/24 is directly connected, Serial0/0
O IA 192.168.3.0/24 [110/128] via 192.168.2.3, 00:00:51, Serial0/0
R2
上是有到达
EIGRP
网路的路由的。由此我们刚才的结论是正确的。
我们来测试一下
r1(config)#do ping 10.1.0 .1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.0 .1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r1(config)#
当我们增加了默认路由后
r1(config)#ip route 0.0.0 .0 0.0.0.0 192.168.1.2
r1(config)#do sh ip rou
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
C 192.168.1.0/24 is directly connected, Serial0/0
O IA 192.168.2.0/24 [110/128] via 192.168.1.2, 00:03:11, Serial0/0
O IA 192.168.3.0/24 [110/192] via 192.168.1.2, 00:02:21, Serial0/0
S* 0.0.0 .0/0 [1/0] via 192.168.1.2
再来测试下
r1(config)#do ping 10.1.0 .1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.0 .1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/150/228 ms
OK
,实验完成