实验:配置OSPF虚链路

  1. R1上的初始配置

R1(config-line)#int s2/1

R1(config-if)#ip add 12.0.0.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#int lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.0

R1(config-if)#router os 1

R1(config-router)#router-id 1.1.1.1

R1(config-router)#net 1.1.1.1 0.0.0.0 a 0

R1(config-router)#net 12.0.0.1 0.0.0.0 a 0

  1. R2上的初始配置:

R2(config-line)#int s2/1

R2(config-if)#ip add 12.0.0.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#int s2/2

R2(config-if)#ip add 23.0.0.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#int lo 0

R2(config-if)#ip add 2.2.2.2 255.255.255.0

R2(config-if)#router os 1

R2(config-router)#router-id 2.2.2.2

R2(config-router)#net 2.2.2.2 0.0.0.0 a 0

R2(config-router)#net 12.0.0.2 0.0.0.0 a 0

R2(config-router)#net 23.0.0.2 0.0.0.0 a 1

  1. R3上的初始配置:

R3(config-line)#int s2/1

R3(config-if)#ip add 23.0.0.3 255.255.255.0

R3(config-if)#no sh

R3(config-if)#int s2/2

R3(config-if)#ip add 34.0.0.3 255.255.255.0

R3(config-if)#no sh

R3(config-if)#int lo 0

R3(config-if)#ip add 3.3.3.3 255.255.255.0

R3(config-if)#router os 1

R3(config-router)#router-id 3.3.3.3

R3(config-router)#net 3.3.3.3 0.0.0.0 a 0

R3(config-router)#net 23.0.0.3 0.0.0.0 a 1

R3(config-router)#net 34.0.0.3 0.0.0.0 a 0

  1. R4上的初始配置:

R4(config-line)#int s2/1

R4(config-if)#ip add 34.0.0.4 255.255.255.0

R4(config-if)#no sh

R4(config-if)#int lo 0

R4(config-if)#ip add 4.4.4.4 255.255.255.0

R4(config-if)#router os 1

R4(config-router)#router-id 4.4.4.4

R4(config-router)#net 4.4.4.4 0.0.0.0 a 0

R4(config-router)#net 34.0.0.4 0.0.0.0 a 0

  1. 在R1上查看路由表信息

R1(config-router)#do sh ip rout

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

     2.0.0.0/32 is subnetted, 1 subnets

O       2.2.2.2 [110/65] via 12.0.0.2, 00:06:09, Serial2/1

     23.0.0.0/24 is subnetted, 1 subnets

O IA    23.0.0.0 [110/128] via 12.0.0.2, 00:06:09, Serial2/1

     12.0.0.0/24 is subnetted, 1 subnets

C       12.0.0.0 is directly connected, Serial2/1

以上输出表明,R1不能获知分割开的Area 0的路由信息,需要将Area 0 连在一起。

  • 实验步骤:
  1. 在R2上配置虚链路:

R2(config-router)#area 1 virtual-link 3.3.3.3

  1. 在R3上配置虚链路:

R3(config-router)#area 1 virtual-link 2.2.2.2

  • 实验调试

//在R1上查看路由表:

R1(config-router)#do sh ip rout

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

     34.0.0.0/24 is subnetted, 1 subnets

O       34.0.0.0 [110/192] via 12.0.0.2, 00:05:54, Serial2/1

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     2.0.0.0/32 is subnetted, 1 subnets

O       2.2.2.2 [110/65] via 12.0.0.2, 00:05:54, Serial2/1

     3.0.0.0/32 is subnetted, 1 subnets

O       3.3.3.3 [110/129] via 12.0.0.2, 00:05:54, Serial2/1

     4.0.0.0/32 is subnetted, 1 subnets

O       4.4.4.4 [110/193] via 12.0.0.2, 00:05:54, Serial2/1

     23.0.0.0/24 is subnetted, 1 subnets

O IA    23.0.0.0 [110/128] via 12.0.0.2, 00:05:54, Serial2/1

     12.0.0.0/24 is subnetted, 1 subnets

C       12.0.0.0 is directly connected, Serial2/1

以上输出表明,可以通过虚链路讲分割开的区域连在一起。

       //在R2上查看虚链路的配置

R2(config-router)#do sh ip os v

Virtual Link OSPF_VL0 to router 3.3.3.3 is up//虚链路已成功建立

  Run as demand circuit

  DoNotAge LSA allowed.

  Transit area 1, via interface Serial2/2, 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:09

    Adjacency State FULL (Hello suppressed)//状态已经Full

    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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值