ospf学习笔记 下载本文

内容发布更新时间 : 2024/11/14 11:01:10星期一 下面是文章的全部内容请认真阅读。

Ospf

1. 如图

R1

Router>enable Router#configure t

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname r1 r1(config)#ip domain-lookup r1(config)#lin console 0 r1(config-line)#exec-timeout 00 r1(config-line)#logging sy r1(config-line)#exit r1(config)#interface s1/1

r1(config-if)#ip address 1.1.1.1 255.255.255.0 r1(config-if)#no shutdown r1(config-if)#EXI

00:00:52: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up

00:00:53: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up r1(config-if)#EXIT r1(config)#exit

00:00:58: %SYS-5-CONFIG_I: Configured from console by console

00:01:13: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down 00:01:23: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up r1#ping 1.1.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds: !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/29/36 ms r1#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: .....

Success rate is 0 percent (0/5) r1#conf t

Enter configuration commands, one per line. End with CNTL/Z. r1(config)#router ospf 1

r1(config-router)#network 1.1.1.0 0.0.0.255 area 1 r1(config-router)#exit r1(config)# r1(config)#exit r1#ping

00:02:47: %SYS-5-CONFIG_I: Configured from console by console r1#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: .

00:02:51: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial1/1 from LOADING to FULL, Loading Done....

Success rate is 0 percent (0/5) r1#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/25/32 ms r1#ping 2.2.2.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds: !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/63/80 ms

r1#show 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, 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, Serial1/1 2.0.0.0/24 is subnetted, 1 subnets

O 2.2.2.0 [110/128] via 1.1.1.2, 00:02:39, Serial1/1

R2

Router>enable Router#configure t

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname r2 r2(config)#ip domain-lookup r2(config)#lin console 0 r2(config-line)#exec-timeout 00 r2(config-line)#logging sy r2(config-line)#exit r2(config)#interface s1/0

r2(config-if)#ip address 1.1.1.2 255.255.255.0 r2(config-if)#no shutdown r2(config-if)#interface s1/1

r2(config-if)#ip address 2.2.2.2 255.255.255.0 r2(config-if)#no shutdown r2(config-if)#exit r2(config)#exit r2#

00:01:10: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up 00:01:10: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up r2#

00:01:11: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up 00:01:11: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up 00:01:11: %SYS-5-CONFIG_I: Configured from console by console r2#conf t

Enter configuration commands, one per line. End with CNTL/Z. r2(config)#router ospf 1

r2(config-router)#network 1.1.1.0 0.0.0.255 area 1 r2(config-router)#network 2.2.2.0 0.0.0.255 area 1 r2(config-router)#exit

00:02:32: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.1 on Serial1/1 from LOADING to FULL, Loading Done r2(config)#exit r2#

00:02:34: %SYS-5-CONFIG_I: Configured from console by console r2#show 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, 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, Serial1/0 2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Serial1/1

R3

Router>enable Router#configure t

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname r3 r3(config)#ip domain-lookup r3(config)#lin console 0 r3(config-line)#exec-timeout 00 r3(config-line)#logging sy r3(config-line)#exit r3(config)#interface s1/0

r3(config-if)#ip address 2.2.2.1 255.255.255.0 r3(config-if)#no shutdown r3(config-if)#exit r3(config)#exit r3#

00:01:22: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up r3#ping

00:01:23: %SYS-5-CONFIG_I: Configured from console by console

00:01:23: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up r3#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/29/48 ms r3#ping 1.1.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds: .....

Success rate is 0 percent (0/5) r3#conf t

Enter configuration commands, one per line. End with CNTL/Z. r3(config)#

r3(config)#router ospf 1

r3(config-router)#network 2.2.2.0 0.0.0.255 area 1 r3(config-router)#exit r3(config)# r3(config)# r3(config)#exit r3# r3#

00:02:13: %SYS-5-CONFIG_I: Configured from console by console r3#

00:02:31: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial1/0 from LOADING to FULL, Loading Done r3#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 = 48/66/92 ms r3#ping 1.1.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds: !!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 28/41/64 ms

r3#show 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, 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

O 1.1.1.0 [110/128] via 2.2.2.2, 00:08:38, Serial1/0 2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Serial1/0 r3#