R1R2R3上进行基本配制<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#no ip http server
Router(config)#line c 0
Router(config-line)#no exec-t
Router(config-line)#logg sy
Router(config-line)#pass cisco
Router(config-line)#line vty 0 4
Router(config-line)#logg sy
Router(config-line)#no exec-t
Router(config-line)#pass cisco
Router(config-line)#
Router(config-line)#exit
Router(config)#hostname R1

 

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#no ip http server
Router(config)#line c 0
Router(config-line)#no exec-t
Router(config-line)#logg sy
Router(config-line)#pass cisco
Router(config-line)#line vty 0 4
Router(config-line)#logg sy
Router(config-line)#no exec-t
Router(config-line)#pass cisco
Router(config-line)#exit
Router(config)#hostname R2

 

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#no ip http server
Router(config)#line c 0
Router(config-line)#no exec-t
Router(config-line)#logg sy
Router(config-line)#pass cisco
Router(config-line)#line vty 0 4
Router(config-line)#logg sy
Router(config-line)#no exec-t
Router(config-line)#pass cisco
Router(config-line)#exit
Router(config)#hostname R3

 

R1R2R3上进行接口及帧中继基本配制

R1(config)#int lo 0
R1(config-if)#ip add <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.1.1.1 255.255.255.255
R1(config-if)#int lo 1
R1(config-if)#ip add 192.1.1.1 255.255.255.255
R1(config-if)#int s 3/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#en frame-relay
R1(config-if)#no sh

 

R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#int lo 1
R2(config-if)#ip add 192.2.2.2 255.255.255.255
R2(config-if)#int s 3/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#en fr
R2(config-if)#no sh

 

R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#int lo 1
R3(config-if)#ip add 192.3.3.3 255.255.255.255
R3(config-if)#int s 3/0
R3(config-if)#ip add 10.1.1.3 255.255.255.0
R3(config-if)#en fr
R3(config-if)#no sh

 

R1R2R3上进行OSPF配制
R1(config)#router ospf 1
R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 192.1.1.1 0.0.0.0 area 0
R1(config-router)#neighbor 10.1.1.2
R1(config-router)#neighbor 10.1.1.3

 

R2(config)#router ospf 1
R2(config-router)#net 2.2.2.2 0.0.0.0 area 0
R2(config-router)#net 192.2.2.2 0.0.0.0 area 0
R2(config-router)#net 10.1.1.0 0.0.0.255 area 0
R2(config-router)#neig
R2(config-router)#neighbor 10.1.1.1
R2(config-router)#neighbor 10.1.1.3
R2(config-router)#neighbor 1.1.1.1
OSPF: Neighbor address does not map to an interface
R2(config-router)#
R2(config-router)#end

 

R3(config)#router ospf 1
R3(config-router)#net 10.1.1.0 0.0.0.255 area 0
R3(config-router)#net 3.3.3.3 0.0.0.0 area 0
R3(config-router)#net 192.3.3.3 0.0.0.0 area 0
R3(config-router)#neig
R3(config-router)#neighbor 10.1.1.1
R3(config-router)#neighbor 10.1.1.2
R3(config-router)#end

 

进行测试

R2#ping 3.3.3.3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/40/68 ms
R2#ping 1.1.1.1

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/48/80 ms
R2#ping 10.1.1.1

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/34/56 ms
R2#ping 10.1.1.3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/34/44 ms
R2#ping 192.1.1.1

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/48 ms
R2#ping 192.2.2.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R2#ping 192.3.3.3 

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/45/52 ms

 

Show ip route

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR
       T - traffic engineered route

 

Gateway of last resort is not set

 

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial3/0
     192.1.1.0/32 is subnetted, 1 subnets
C       192.1.1.1 is directly connected, Loopback1

 

DEBUG信息

R1#debug ip ospf packet
OSPF packet debugging is on
R1#
00:18:07: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:18:27: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:18:37: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:18:57: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:19:07: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:19:27: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:19:37: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:19:57: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:20:07: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:20:27: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:20:37: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:20:57: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:21:07: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:21:27: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#
00:21:37: OSPF: rcv. v:2 t:1 l:52 rid:192.3.3.3
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0
R1#u all
All possible debugging has been turned off
R1#
00:21:57: OSPF: rcv. v:2 t:1 l:52 rid:192.2.2.2
      aid:0.0.0.0 chk:A01F aut:0 auk: from Serial3/0