频道栏目
首页 > 网络 > 其他 > 正文

思科OSPF单区域配置 - DY - 51CTO技术博客

2019-04-12 15:13:47         来源:郭陈勇 的BLOG   
收藏   我要投稿

实验拓扑图

c51fb20985572813c092d261b83c75b8.png

R1路由器的配置

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#int e0/0

R1(config-if)#ip address 192.168.20.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#int e0/1

R1(config-if)#ip address 192.168.10.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#int loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config-if)#no sh

R1(config-if)#exit

R1(config)#router ospf 1

R1(config-router)#network 192.168.10.0 0.0.0.255 area 0

R1(config-router)#network 192.168.20.0 0.0.0.255 area 0

R1(config-router)#exit

R1(config)#do sh ip int br

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 192.168.20.1 YES manual up up

Ethernet0/1 192.168.10.1 YES manual up up

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

Loopback0 1.1.1.1 YES manual up up

R1#sh ip route

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/32 is subnetted, 1 subnets

C 1.1.1.1 is directly connected, Loopback0

O 192.168.30.0/24 [110/20] via 192.168.20.2, 00:00:08, Ethernet0/0

C 192.168.10.0/24 is directly connected, Ethernet0/1

O 192.168.40.0/24 [110/30] via 192.168.20.2, 00:00:08, Ethernet0/0

C 192.168.20.0/24 is directly connected, Ethernet0/0


R2路由器的配置

R2#

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#int e0/0

R2(config-if)#ip address 192.168.20.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#int e0/1

R2(config-if)#ip address 192.168.30.1 255.255.255.0

R2(config-if)#no sh

R2(config-if)#int loopback 0

R2(config-if)#ip address 2.2.2.2 255.255.255.255

R2(config-if)#no sh

R2(config-if)#exit

R2(config)# router ospf 1

R2(config-router)#network 192.168.20.0 0.0.0.255 area 0

R2(config-router)#network 192.168.30.0 0.0.0.255 area 0

R2(config-router)#exit

R2(config)#do sh ip int br

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 192.168.20.2 YES manual up up

Ethernet0/1 192.168.30.1 YES manual up up

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

Loopback0 2.2.2.2 YES manual up up

R2(config)#do sh ip route

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


2.0.0.0/32 is subnetted, 1 subnets

C 2.2.2.2 is directly connected, Loopback0

C 192.168.30.0/24 is directly connected, Ethernet0/1

O 192.168.10.0/24 [110/20] via 192.168.20.1, 00:04:51, Ethernet0/0

O 192.168.40.0/24 [110/20] via 192.168.30.2, 00:04:51, Ethernet0/1

C 192.168.20.0/24 is directly connected, Ethernet0/0


R3路由器的配置

R3#

R3#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#int e0/0

R3(config-if)#ip address 192.168.30.2 255.255.255.0

R3(config-if)#no sh

R3(config-if)#int e0/1

R3(config-if)#ip address 192.168.40.1 255.255.255.0

R3(config-if)#no sh

R3(config-if)#int loopback 0

R3(config-if)#ip address 3.3.3.3 255.255.255.255

R3(config-if)#no sh

R3(config-if)#exit

R3(config)#router ospf 1

R3(config-router)#network 192.168.30.0 0.0.0.255 area 0

R3(config-router)#network 192.168.40.0 0.0.0.255 area 0

R3(config)#do sh ip route

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


3.0.0.0/32 is subnetted, 1 subnets

C 3.3.3.3 is directly connected, Loopback0

C 192.168.30.0/24 is directly connected, Ethernet0/0

O 192.168.10.0/24 [110/30] via 192.168.30.1, 00:08:32, Ethernet0/0

C 192.168.40.0/24 is directly connected, Ethernet0/1

O 192.168.20.0/24 [110/20] via 192.168.30.1, 00:08:32, Ethernet0/0

R3(config)#

验证PC机互相访问

36c38bbe2d4c4694d0e41875c70db41d.png

a519cc9f0fe988d2492082cacd57a059.png


最后验证成功

本文出自 “DY” 博客,请务必保留此出处http://guochenyong.blog.51cto.com/11367898/1976681

上一篇:【安全牛学习笔记】安装java、安装显卡驱动、安装网卡补丁、并发线程限制、电源优化 - 11662938 - 51CTO技术博客
下一篇:【安全牛学习笔记】信息统计 - 11662938 - 51CTO技术博客
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站