您的位置:首页 > 其它

实验13 OSPF基本配置

2018-11-16 00:54 85 查看

实验名称】OSPF基本配置
实验目的】掌握在路由器上配置OSPF 单区域
实验设备】三层交换机1台、路由器2台、主机5台、交叉线4条、直通线3条
实验拓扑

实验步骤
步骤1 配置三层交换机IP地址

Switch>en
Switch#conf t
Switch(config)#vlan 10
Switch(config-vlan)#ex

Switch(config)#vlan 50
Switch(config-vlan)#ex

Switch(config)#int f0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex

Switch(config)#int f0/2
Switch(config-if)#switchport access vlan 50
Switch(config-if)#ex

Switch(config)#int f0/24
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex

Switch(config)#int vlan 10
Switch(config-if)#ip add 172.16.1.2 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#ex

Switch(config)#int vlan 50
Switch(config-if)#ip add 172.16.5.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#ex

Switch(config)#int f0/1
Switch(config-if)#sw
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex

Switch(config)#int f0/2
Switch(config-if)#switchport access vlan 50
Switch(config-if)#ex

Switch(config)#int f0/24
Switch(config-if)#switchport access vlan 10
Switch(config-if)#ex
Switch(config)#

步骤2 配置路由器IP地址

//路由器R-A:
Router>en
Router#conf t
Router(config)#hostname R-A
R-A (config)#int g0/0
R-A (config-if)#ip add 172.16.1.1 255.255.255.0
R-A (config-if)#no sh
R-A (config-if)#
R-A (config-if)#ex

R-A (config)#int g0/1
R-A (config-if)#ip add 172.16.2.1 255.255.255.0
R-A (config-if)#no sh
R-A (config-if)#ex

R-A (config)#int g0/2
R-A (config-if)#ip add 172.16.4.1 255.255.255.0
R-A (config-if)#no sh
R-A (config-if)#ex
//路由器R-B:
Router>en
Router#conf t
Router(config)#hostname R-B
R-B(config)#int g0/0
R-B(config-if)#ip add 172.16.2.2 255.255.255.0
R-B(config-if)#no sh
R-B(config-if)#
R-B(config-if)#ex

R-B(config)#int g0/1
R-B(config-if)#ip add 172.16.3.1 255.255.255.0
R-B(config-if)#no sh
R-B(config-if)#
R-B(config-if)#ex

R-B(config)#int g0/2
R-B(config-if)#ip add 172.16.6.1 255.255.255.0
R-B(config-if)#no sh
R-B(config-if)#
R-B(config-if)#ex
R-B(config)#

步骤3 配置OSPF路由协议

//三层交换机:
Switch>en
Switch#conf t
Switch(config)#ip routing //思科三层交换机需要加上此命令才能执行router ospf操作
Switch(config)#router ospf 1
Switch(config-router)#network 172.16.1.0 0.0.0.255 area 0
Switch(config-router)#network 172.16.5.0 0.0.0.255 area 0
Switch(config-router)#end
//路由器R-A
R-A>en
R-A#conf t
R-A(config)#router ospf 1
R-A(config-router)#network 172.16.1.0 0.0.0.255 area 0
R-A(config-router)#network 172.16.2.0 0.0.0.255 area 0
R-A(config-router)#network 172.16.4.0 0.0.0.255 area 0
R-A(config-router)#end
//路由器R-B
R-B>en
R-B#conf t
R-B(config)#router ospf 1
R-B(config-router)#network 172.16.2.0 0.0.0.255 area 0
R-B(config-router)#network 172.16.3.0 0.0.0.255 area 0
R-B(config-router)#network 172.16.6.0 0.0.0.255 area 0
R-B(config-router)#end

步骤4 配置电脑网关及IP地址

//PC0
网关:172.16.1.2
IP地址:172.16.1.3
子网掩码:255.255.255.0
//PC1
网关:172.16.5.1
IP地址:172.16.5.2
子网掩码:255.255.255.0
//PC2
网关:172.16.4.1
IP地址:172.16.4.2
子网掩码:255.255.255.0
//PC3
网关:172.16.3.1
IP地址:172.16.3.2
子网掩码:255.255.255.0
//PC4
网关:172.16.6.1
IP地址:172.16.6.2
子网掩码:255.255.255.0

步骤5 验证测试

PC>ping 172.16.1.3

Pinging 172.16.1.3 with 32 bytes of data:

Request timed out.
Reply from 172.16.1.3: bytes=32 time=5ms TTL=127
Reply from 172.16.1.3: bytes=32 time=15ms TTL=127
Reply from 172.16.1.3: bytes=32 time=11ms TTL=127

Ping statistics for 172.16.1.3:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 15ms, Average = 10ms
PC>ping 172.16.5.2

Pinging 172.16.5.2 with 32 bytes of data:

Request timed out.
Reply from 172.16.5.2: bytes=32 time=22ms TTL=126
Reply from 172.16.5.2: bytes=32 time=0ms TTL=126
Reply from 172.16.5.2: bytes=32 time=11ms TTL=126

Ping statistics for 172.16.5.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 22ms, Average = 11ms
PC>ping 172.16.3.2

Pinging 172.16.3.2 with 32 bytes of data:

Request timed out.
Reply from 172.16.3.2: bytes=32 time=25ms TTL=126
Reply from 172.16.3.2: bytes=32 time=14ms TTL=126
Reply from 172.16.3.2: bytes=32 time=0ms TTL=126

Ping statistics for 172.16.3.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 25ms, Average = 13ms
PC>ping 172.16.4.2

Pinging 172.16.4.2 with 32 bytes of data:

Reply from 172.16.4.2: bytes=32 time=1ms TTL=128
Reply from 172.16.4.2: bytes=32 time=1ms TTL=128
Reply from 172.16.4.2: bytes=32 time=2ms TTL=128
Reply from 172.16.4.2: bytes=32 time=2ms TTL=128

Ping statistics for 172.16.4.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: