扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
A 配置动态路由OSPF
B 查看路由配置OSPF
C 验证动态路由OSPF
本人个人经验所写,有误的话请愿谅。
A 步骤一(基本配置):
R1上的命令:
en
config terminal
hostname R1
interface fastethernet0/0
ip address 192.168.0.254 255.255.255.0
no shutdown
interface serial1/0
ip address 10.0.0.1 255.0.0.0
clock rate 72000
no shutdown
R2上的命令:
en
config terminal
hostname R1
interface fasterethernet0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
interface serial1/0
ip address 10.0.0.2 255.0.0.0
clock rate 72000
no shutdown
步骤二(动态路由OSPF配置):
注意哦:R1和R2动态路由OSPF配置要在全局模式下(config)#
R1上的命令:
R1(config)#route ospf 10
R1(config-router)#network 192.168.0.0 0.0.0.255 area 0
R1(config-router)#network 10.0.0.0 0.255.255.255 area 0
end
write
R2上的命令:
Router(config)#route ospf 10
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 10.0.0.0 0.255.255.255 area 0
end
write
步骤三(pc的配置):
pc1的IP 设为192.168.0.1 255.255.255.0
pc2的IP 设为192.168.1.1 255.255.255.0
我想这个我不用说了吧!!!
B 查看路由配置 用show ip route
R1上显示:
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, 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
C 10.0.0.0/8 is directly connected, Serial1/0
C 192.168.0.0/24 is directly connected, FastEthernet0/0
O 192.168.1.0/24 [110/782] via 10.0.0.2, 00:00:29, Serial1/0
R2上显示:
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, 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
C 10.0.0.0/8 is directly connected, Serial1/0
C 192.168.0.0/24 is directly connected, FastEthernet0/0
O 192.168.1.0/24 [110/782] via 10.0.0.2, 00:00:29, Serial1/0
C 用PC1机器去PING pc2能通则静态路由配置成功.
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者