OSPF的基本配置
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验八OSPF的基本配置OSPF路由协议
基本的OSPF配置
对于基本的OSPF配置,需要进行的操作包括:
●配置Router ID
●启动OSPF
●进入OSPF区域视图
●在指定网段使能OSPF
OSPF的基本配置
【需求】
两台PC所在网段,通过两台使用OSPF协议的路由器实现互连互通。【组网图】
S1/0 S1/0
【验证】
RouterA和RouterB可以通过OSPF学习到对方路由信息,并可以ping通对方网段。RouterA路由表:
[RouterA] dis ip rout
Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface 1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
1.1.1.2/32 OSPF 10 1563 20.1.1.2 Serial0/0 10.1.1.0/24 DIRECT 0 0 10.1.1.1 Ethernet0/0
10.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
20.1.1.0/30 DIRECT 0 0 20.1.1.1 Serial0/0 20.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
20.1.1.2/32 DIRECT 0 0 20.1.1.2 Serial0/0 30.1.1.0/24 OSPF 10 1563 20.1.1.2 Serial0/0 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopB
Ping 30.1.1.2
验证是否PC1能PING 通 PC2 ?
RouterB路由表:
[RouteB]dis ip rout
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 1562 20.1.1.1 S1/0
1.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0 10.1.1.0/24 OSPF 10 1563 20.1.1.1 S1/0 20.1.1.0/30 Direct 0 0 20.1.1.2 S1/0
20.1.1.1/32 Direct 0 0 20.1.1.1 S1/0
20.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0 30.1.1.0/24 Direct 0 0 30.1.1.1 Eth0/0
30.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
程序内容:
%May 22 12:32:45:921 2014 RouterA SHELL/4/LOGIN: Console login from con0
System View: return to User View with Ctrl+Z.
[RouterA]interface Ethernet0/0
[RouterA-Ethernet0/0]ip address 10.1.1.1 255.255.255.0
% Error: The IP address you entered overlaps with another interface! [RouterA-Ethernet0/0]interface Serial 1/0
[RouterA-Serial1/0]ip address 10.1.1.1 255.255.255.0
%May 22 12:35:01:845 2014 RouterA IFNET/4/UPDOWN: Protocol PPP IPCP on the interface Serial1/0 is DOWN
%May 22 12:35:04:847 2014 RouterA IFNET/4/UPDOWN: Protocol PPP IPCP on the interface Serial1/0 is UP
[RouterA-Serial1/0]
%May 22 12:35:16:553 2014 RouterA IFNET/4/UPDOWN: Protocol PPP IPCP on the interface Serial1/0 is DOWN [RouterA-Serial1/0]
%May 22 12:35:19:562 2014 RouterA IFNET/4/UPDOWN: Protocol PPP IPCP on the interface Serial1/0 is UP delete
^
% Unrecognized command found at '^' position.
[RouterA-Serial1/0]delete
^
% Unrecognized command found at '^' position.
[RouterA-Serial1/0]quitr
^
% Unrecognized command found at '^' position.
[RouterA-Serial1/0]quit
[RouterA]quit
^
% Incomplete command found at '^' position.
The saved configuration file will be erased. Are you sure? [Y/N]:y
The saved configuration file will be erased. Are you sure? [Y/N]:y Configuration file in cf is being cleared.
Please wait ...
Configuration file does not exist!
System View: return to User View with Ctrl+Z.
[RouterA]interface Ethernet0/0
[RouterA-Ethernet0/0]ip address 10.1.1.1 255.255.255.0
% Error: The IP address you entered overlaps with another interface! [RouterA-Ethernet0/0]interface Serial 1/0
[RouterA-Serial1/0]ip address 10.1.1.2 255.255.255.0
[RouterA-Serial1/0]
%May 22 12:39:26:255 2014 RouterA IFNET/4/UPDOWN: