ospf2

 

OSPF实验4:虚链路

实验等级:Professional

 

实验拓扑:

 

 

实验分析:

     上面这个网络的设计在OSPF中是比较失败的,因为OSPF建议所有的非骨干区域都和骨干区域直连。上面这个网络的设计将会导致Area2的数据和Area0无法通信。为了解决这个问题,一种方法可以在R3R1上增加一条物理链路。还有一种过渡的方法就是使用虚链路。

 

实验基本配置:

 

R1

interface Loopback0

ip address 1.1.1 .1 255.255.255.0

ip ospf network point-to-point

!

interface Serial1/0

ip address 10.1.1 .1 255.255.255.0

serial restart-delay 0

!

router ospf 10

router-id 1.1.1 .1

log-adjacency-changes

network 10.1.1 .0 0.0.0.255 area 0

 

R2

interface Loopback0

 ip address 2.2.2 .2 255.255.255.0

!

interface Serial1/0

 ip address 10.1.1 .2 255.255.255.0

 serial restart-delay 0

!

interface Serial1/1

 ip address 11.1.1 .1 255.255.255.0

 serial restart-delay 0

!

router ospf 10

 router-id 2.2.2 .2

 log-adjacency-changes

 network 10.1.1 .0 0.0.0.255 area 0

 network 11.1.1 .0 0.0.0.255 area 1

 

R3

interface Loopback0

 ip address 3.3.3 .3 255.255.255.0

!

interface Serial1/0

 ip address 11.1.1 .2 255.255.255.0

 serial restart-delay 0

!

router ospf 10

 router-id 3.3.3 .3

 log-adjacency-changes

 network 3.3.3 .0 0.0.0.255 area 2

 network 11.1.1 .0 0.0.0.255 area 1

 

我们在R1上查看路由表,发现没有R3Loopback接口路由:

 

R1#sho ip rou

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     1.0.0 .0/24 is subnetted, 1 subnets

C       1.1.1 .0 is directly connected, Loopback0

     10.0.0 .0/24 is subnetted, 1 subnets

C       10.1.1 .0 is directly connected, Serial1/0

     11.0.0 .0/24 is subnetted, 1 subnets

O IA    11.1.1 .0 [110/128] vi a 10.1.1 .2, 00:04:50, Serial1/0

 

为了让R1学习到R3的路由,我们配置虚链路。

 

虚链路的配置:

 

虚链路必须配置在ABR,在这个网络中ABRR2R3

虚链路的配置使用的命令是area transit-area-id virtual-link router-id。我们现在在R2R3上进行配置。

 

R2(config)#router ospf 10

R2(config-router)#area 1 virtual-link 3.3.3 .3

R3(config)#router ospf 10

R3(config-router)#area 1 virtual-link 2.2.2 .2

 

等虚链路起来后,我们查看其状态:

 

R2#sho ip ospf virtual-links

Virtual Link OSPF_VL0 to router 3.3.3 .3 is up

  Run as demand circuit

  DoNotAge LSA allowed.

  Transit area 1, via interface Serial1/1, Cost of using 64

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    Hello due in 00:00:05

    Adjacency State FULL (Hello suppressed)

    Index 2/3, retransmission queue length 0, number of retransmission 1

    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)

    Last retransmission scan length is 1, maximum is 1

    Last retransmission scan time is 0 msec, maximum is 0 msec

 

在上面的信息中我们可以看到。虚链路在逻辑上是等同于一条物理的按需链路,既只有在两端路由器的配置有变动的时候才进行更新,并且使用的是不老化(DoNotAgeLSA,既虚链路是无须Hello包控制的。

 

R1#sho ip rou

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     1.0.0 .0/24 is subnetted, 1 subnets

C       1.1.1 .0 is directly connected, Loopback0

     3.0.0 .0/32 is subnetted, 1 subnets

O IA    3.3.3 .3 [110/129] vi a 10.1.1 .2, 00:03:02, Serial1/0

     10.0.0 .0/24 is subnetted, 1 subnets

C       10.1.1 .0 is directly connected, Serial1/0

     11.0.0 .0/24 is subnetted, 1 subnets

O IA    11.1.1 .0 [110/128] vi a 10.1.1 .2, 00:03:02, Serial1/0

 

这时看到R1已经学习到了R3环回口的路由。Metric值为129虚链路的Metric等同于所经过的全部链路开销之和,在这个网络中,Metric=1Loopback+64+64=129

 

R1上查看OSPF数据库:

R1#show ip ospf database

 

            OSPF Router with ID ( 1.1.1 .1) (Process ID 10)

 

                Router Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

1.1.1 .1         1.1.1 .1         797         0x80000002 0x00B 9C 0 2

2.2.2 .2         2.2.2 .2         369         0x80000004 0x00DD29 3

3.3.3 .3         3.3.3 .3         6     (DNA) 0x80000002 0x008B35 1

 

                Summary Net Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum

3.3.3 .3         3.3.3 .3         12    (DNA) 0x80000001 0x00AE75

11.1.1 .0        2.2.2 .2         789         0x80000001 0x0029BE

11.1.1 .0        3.3.3 .3         12    (DNA) 0x80000001 0x000BD8

 

这里的(DNA)就是DoNotAge

 

 

总结:

 

   虚链路被看成网络设计失败的一种补救手段,它不仅可以让没有和骨干区域直连的非骨干区域在逻辑上建立一条链路,还可以连接两个分离的骨干区域。但是由于虚链路的配置会造成日后维护和排错的困难。所以在进行网络设计的时候,不能将虚链路考虑进去。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值