OSPF虚链路的链接
liyuning - BY - 2008-8-20 15:01:02



试验标题:

OSPF的虚链路配置

试验拓扑:


 

 

实验配置:

各路由器的基本配置:


R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#inter s2/1
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit        
R1(config)#router ospf 1
R1(config-router)#network 12.0.0.1 0.0.0.0 area 0
R1(config-router)#exit
R1(config)#end
R1#
*Aug 19 23:19:30.447: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Aug 19 23:20:07.759: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
R1#
*Aug 19 23:20:30.235: %OSPF-5-ADJCHG: Process 1, Nbr 23.0.0.2 on Serial2/1 from LOADING to FULL, Loading Done
R1#
R1#show ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial2/0                  unassigned      YES unset  administratively down down   
Serial2/1                  12.0.0.1        YES manual up                    up     
Serial2/2                  unassigned      YES unset  administratively down down   
Serial2/3                  unassigned      YES unset  administratively down down   
Serial3/0                  unassigned      YES unset  administratively down down   
Serial3/1                  unassigned      YES unset  administratively down down   
Serial3/2                  unassigned      YES unset  administratively down down   
Serial3/3                  unassigned      YES unset  administratively down down 

 

Router>
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host R2
R2(config)#line con 0
R2(config-line)#no exec-ti
R2(config-line)#no exec-timeout
R2(config-line)#logg syn
R2(config-line)#logg synchronous
R2(config-line)#end
R2#
*Aug 19 23:15:44.555: %SYS-5-CONFIG_I: Configured from console by console
R2#
R2#
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#inter s2/1
R2(config-if)#ip add 12.0.0.2 255.255.255.0.

R2(config-if)#no shut
R2(config-if)#exit
R2(config)#inter ser2/2
R2(config-if)#
*Aug 19 23:19:18.931: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
R2(config-if)#
*Aug 19 23:19:19.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
R2(config-if)#inter ser2/2
R2(config-if)#ip add 23.0.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#net 12.0.0.2 0.0.0.0 area 0
R2(config-router)#net 2
*Aug 19 23:19:55.783: %OSPF-5-ADJCHG: Process 1, Nbr 12.0.0.1 on Serial2/1 from LOADING to FULL, Loading Done
*Aug 19 23:19:56.019: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to down
R2(config-router)#net 23.0.0.2 0.0.0.0 area 1
R2(config-router)#exit
R2(config)#end
R2#
*Aug 19 23:20:19.023: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Aug 19 23:21:45.983: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
R2#
*Aug 19 23:22:58.399: %OSPF-5-ADJCHG: Process 1, Nbr 34.0.0.3 on Serial2/2 from LOADING to FULL, Loading Done
R2#
R2#show ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial2/0                  unassigned      YES unset  administratively down down   
Serial2/1                  12.0.0.2        YES manual up                    up     
Serial2/2                  23.0.0.2        YES manual up                    up     
Serial2/3                  unassigned      YES unset  administratively down down   
Serial3/0                  unassigned      YES unset  administratively down down   
Serial3/1                  unassigned      YES unset  administratively down down   
Serial3/2                  unassigned      YES unset  administratively down down   
Serial3/3                  unassigned      YES unset  administratively down down   

Router>
Router>ena
Router#
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host R3.

R3(config)#line con 0
R3(config-line)#no exec-timeout
R3(config-line)#logg synchronous
R3(config-line)#end
R3#
*Aug 19 23:17:17.755: %SYS-5-CONFIG_I: Configured from console by console
R3#
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#host R3
R3(config)#line con 0
R3(config-line)#no exec-timeout
R3(config-line)#logging synchronous
R3(config-line)#end
R3#
*Aug 19 23:17:32.195: %SYS-5-CONFIG_I: Configured from console by console
R3#
R3#
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#inter s2/1
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter
*Aug 19 23:20:46.863: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
*Aug 19 23:20:47.863: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up.

R3(config-if)#exit
R3(config)#inter ser2/2
R3(config-if)#ip add 34.0.0.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#
*Aug 19 23:21:13.927: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up
R3(config)#
*Aug 19 23:21:14.931: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
R3(config)#router ospf 1
R3(config-router)#network 23.0.0.3 0.0.0.0 area 1
R3(config-router)#net 34.0.0.3 0.0.0.0 area 1
R3(config-router)#exit
R3(config)#end
R3#
R3#
*Aug 19 23:23:56.211: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
R3#
*Aug 19 23:25:05.311: %OSPF-5-ADJCHG: Process 1, Nbr 45.0.0.4 on Serial2/2 from LOADING to FULL, Loading Done
R3#
R3#show ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial2/0                  unassigned      YES unset  administratively down down   
Serial2/1                  23.0.0.3        YES manual up                    up     
Serial2/2                  34.0.0.3        YES manual up                    up     
Serial2/3                  unassigned      YES unset  administratively down down   
Serial3/0                  unassigned      YES unset  administratively down down   
Serial3/1                  unassigned      YES unset  administratively down down   
Serial3/2                  unassigned      YES unset  administratively down down   
Serial3/3                  unassigned      YES unset  administratively down down   
R3#

 

 

R4#
R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#inter ser2/1
R4(config-if)#ip add 34.0.0.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit

R4(config)#inter ser2/2
R4(config-if)#ip add 45.0.0.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit
R4(config)#
*Aug 19 23:22:43.427: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up
R4(config)#
*Aug 19 23:22:44.431: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
R4(config)#router ospf 1
R4(config-router)#net 34.0.0.4 0.0.0.0 area 1
R4(config-router)#net
*Aug 19 23:23:16.099: %OSPF-5-ADJCHG: Process 1, Nbr 34.0.0.3 on Serial2/1 from LOADING to FULL, Loading Done
R4(config-router)#net 45.0.0.4 0.0.0.0 area 0
R4(config-router)#exit
R4(config)#end
R4#
*Aug 19 23:23:40.767: %SYS-5-CONFIG_I: Configured from console by console
R4#
*Aug 19 23:24:38.691: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
R4#
*Aug 19 23:25:10.643: %OSPF-5-ADJCHG: Process 1, Nbr 45.0.0.5 on Serial2/2 from LOADING to FULL, Loading Done
R4#show ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial2/0                  unassigned      YES unset  administratively down down   
Serial2/1                  34.0.0.4        YES manual up                    up     
Serial2/2                  45.0.0.4        YES manual up                    up     
Serial2/3                  unassigned      YES unset  administratively down down   
Serial3/0                  unassigned      YES unset  administratively down down   
Serial3/1                  unassigned      YES unset  administratively down down   
Serial3/2                  unassigned      YES unset  administratively down down   
Serial3/3                  unassigned      YES unset  administratively down down   
R4#

 

R5#
R5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#inter ser2/2
R5(config-if)#ip add 45.0.0.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#exit
R5(config)#router o
*Aug 19 23:23:39.839: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up
R5(config)#router ospf 1
R5(config-router)#net 45.0.0.5 0.0.0.0 area 0
R5(config-router)#
*Aug 19 23:24:06.899: %OSPF-5-ADJCHG: Process 1, Nbr 45.0.0.4 on Serial2/2 from LOADING to FULL, Loading Done.

R5(config-router)#exit
R5(config)#end
R5#

 

在R2上配置虚链路:

R2(config)#router ospf 1//启动OSPF进程1

R2(config-router)#area 1 virtual-link 45.0.0.4  ///指定区域1中的虚链路对端的地址
R2(config-router)#end
R2#
*Aug 19 23:32:45.671: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Aug 19 23:33:35.203: %OSPF-5-ADJCHG: Process 1, Nbr 45.0.0.4 on OSPF_VL0 from LOADING to FULL, Loading Done
R2#

在R4上配置虚链路:

R4(config)#router ospf 1
R4(config-router)#area 1
*Aug 19 23:33:39.171: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 23.0.0.2, Serial2/1
R4(config-router)#area 1 virtual-link 23.0.0.2
R4(config-router)#end
R4#
*Aug 19 23:34:02.219: %OSPF-5-ADJCHG: Process 1, Nbr 23.0.0.2 on OSPF_VL0 from LOADING to FULL, Loading Done
R4#
*Aug 19 23:34:03.275: %SYS-5-CONFIG_I: Configured from console by console
R4#
R4#
R4#show ip ospf virtual-links   ///查看R4的虚链路的配置
Virtual Link OSPF_VL0 to router 23.0.0.2 is up     //到23.0.0.2(R2的R outer ID)的虚链路已经建立成功
  Run as demand circuit
  DoNotAge LSA allowed.    ///OSPF在虚链路上运行demand circuit  ,所以LSA不需要刷新(DoNotAge)
  Transit area 1, via interface Serial2/1, Cost of using 128
  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)   ///虚链路的邻接关系一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
试验总结:

根据配置,理解实际的配置原理。

 

 

 

 

 

发表评论:

    昵称:
    密码:
    主页:
    标题:

Powered by Oblog.