最新消息:点击查看大S的省钱秘笈

CCNP实验:隧道技术解决OSPF区域分割问题

CCNP实验 Slyar 72浏览 0评论

文章作者:姜南(Slyar) 文章来源:Slyar Home (www.slyar.com) 转载请注明,谢谢合作。

【实验环境】

C3640-IK9O3S-M Version 12.4(10)

【实验目的】

隧道技术解决OSPF区域分割问题

【实验拓扑】

【实验描述】

Area 2与Area 0没有直接相连,通过在R1和R2上创建tunnel接口,使得R2通过隧道直接接入Area 0来解决区域分割问题。

【实验步骤】

1、R1基本配置

!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Serial0/0
ip address 12.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 0
network 12.0.0.0 0.0.0.255 area 1
!

2、R2基本配置

!
interface Serial0/0
ip address 12.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 23.0.0.1 255.255.255.0
clock rate 64000
!
router ospf 110
router-id 2.2.2.2
network 12.0.0.0 0.0.0.255 area 1
network 23.0.0.0 0.0.0.255 area 2
!

3、R3基本配置

!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Serial0/1
ip address 23.0.0.2 255.255.255.0
!
router ospf 110
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 2
network 23.0.0.0 0.0.0.255 area 2
!

此时Area 2由于没有与Area 0直接相连而无法正常获取路由信息

4、在R1上创建tunnel接口指向R2

//创建隧道接口,接口id任意
interface Tunnel1
//为隧道接口设置逻辑地址,任意,与对端逻辑接口处于同网段即可
ip address 192.168.1.1 255.255.255.0
//设置隧道源,为本地接口
tunnel source 12.0.0.1
//设置隧道目的,为对端接口
tunnel destination 12.0.0.2

5、在R2上创建tunnel接口指向R1

interface Tunnel1
ip address 192.168.1.2 255.255.255.0
tunnel source 12.0.0.2
tunnel destination 12.0.0.1

6、测试隧道

//在R2上ping隧道对端的逻辑地址,只要隧道源与隧道目的之间有路由,隧道即可成功创建,此时R2相当于直接挂在R1上
R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/33/84 ms

7、在R2上将隧道接口宣告进入OSPF AREA 0

router ospf 110
network 192.168.1.0 0.0.0.255 area 0

8、检查R1路由表,观察到Area 2已经变成IA项,证明了上面的结论

R1#sh ip ro

1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/129] via 12.0.0.2, 00:00:30, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
O IA    23.0.0.0 [110/128] via 12.0.0.2, 00:00:30, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial0/0
C    192.168.1.0/24 is directly connected, Tunnel1

9、检查R3路由表,同理

R3#sh ip ro

3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial0/1
12.0.0.0/24 is subnetted, 1 subnets
O IA    12.0.0.0 [110/128] via 23.0.0.1, 00:00:46, Serial0/1
O IA 192.168.1.0/24 [110/11175] via 23.0.0.1, 00:00:46, Serial0/1

10、修改tunnel接口默认带宽

R1#sh int tunnel 1
Tunnel1 is up, line protocol is up
Hardware is Tunnel
Internet address is 192.168.1.1/24
MTU 1514 bytes, BW 9 Kbit, DLY 500000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation TUNNEL, loopback not set
Keepalive not set
Tunnel source 12.0.0.1, destination 12.0.0.2

默认的tunnel接口带宽只有9Kbit,实际应用中可以在接口下使用ip ospf cost修改其在ospf下的度量值

R1(config)#int tunnel 1
R1(config-if)#ip ospf cost 10

R2(config)#int tunnel 1
R2(config-if)#ip ospf cost 10

转载请注明:Slyar Home » CCNP实验:隧道技术解决OSPF区域分割问题

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址