用 GNS3 做CCNA网络实验(6)
2013-06-23 23:38
369 查看
网络协议Cisco软件测试.net
用 GNS3 做CCNA网络实验(6)
9. 路由实验: OSPF
OSPF 路由协议的优点是,它是由 IETF 领导的,不是Cisco的专有协议,因此为多数硬件路由器厂家广泛使用,而且,软件路由器(例如:Vyatta,Zebra 等)就以OSPF协议为主。所以,学习和理解OSPF的配置是很有用处的。
(1) 准备实验
我们假定是关闭 GNS3 后重新打开 GNS3 开始新的实验。
先为这次实验准备一个子目录,例如 在 gns3Project 下建一个子目录 ospf1.
在 GNS3 打开我们以前保存的已经测试过的 topology, 例如 router1.net 然后装入配置文件。
在 GNS3 菜单 File -> Save topology as 把这个 topology 改名为 ospf1.net 并保存 到 ospf1 子目录下。
在 菜单 File -> Import/Export 选 Export to a directory 把原来的配置卸出到子目录 ospf1 下。
这样,下面的实验所用到的 topology 和配置文件均保存在这个子目录下。
在这个实验,我们假定 OSPF 的 process ID 是 1, 而 area 是 0.
现在 启动各个路由器 (R1,R2,PC1,和 PC2),并打开各个 控制台 Console。
(2) 查看路由协议配置前的路由信息
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#show ip route
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R2#show ip route
(3) 配置路由器
R1:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 1
R1(config-router)#network 192.168.100.0 0.0.0.255 area 0
R1(config-router)#network 172.17.1.0 0.0.0.3 area 0
R1(config-router)#^Z
R1#
R1#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
*Mar 1 00:13:45.819: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.110.253 on Serial2/0 from LOADING to FULL, Loading Done
R1#
![](http://dl.iteye.com/upload/attachment/499374/a260d647-3b9d-3b78-a479-e7db3fea4fe9.png)
R2:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#network 192.168.110.0 0.0.0.255 area 0
R2(config-router)#network 172.17.1.0 0.0.0.3 area 0
R2(config-router)#^Z
R2#
*Mar 1 00:13:43.179: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:13:44.195: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.100.254 on Serial2/1 from LOADING to FULL, Loading Done
R2#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R2#
![](http://dl.iteye.com/upload/attachment/499376/62c96cc6-18d8-3259-bbea-9c03a66d762d.png)
(4) 测试
从 PC1 ping
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
PC1>ping 192.168.110.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 432/773/1872 ms
PC1>ping 192.168.110.22
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 596/792/892 ms
PC1>
从 PC2 ping
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
PC2>ping 192.168.100.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 812/1116/1324 ms
PC2>ping 192.168.100.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1420/1599/1892 ms
PC2>
(5) 启用路由协议后的路由信息
R1:
![](http://dl.iteye.com/upload/attachment/499387/02072e70-74c9-3ce4-b57f-c70394b532fa.png)
R2:
![](http://dl.iteye.com/upload/attachment/499389/8c204b8c-1902-3569-b6eb-1d4b0cf73fc0.png)
(6) 关闭 cdp 信息
在我们的 topology 中, 由于 R1 和 R2 连接局域网段的是 Ethernet 口, 而 PC1 和 PC2 则是 FastEthernet 口,所以在控制台不断冒出 CDP 信息:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
%CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethernet1/0 (not full duplex), with PC1 FastEthernet0/0 (full duplex).
这信息对路由器设置和使用没有影响,但对阅读控制台的信息输出就造成混乱。关闭这个信息:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e1/0
R1(config-if)#no cdp enable
R1(config-if)#^Z
R1#
在 R1 和 R2 输入如上类似的设置(端口要按实际连接来定),之后控制台就不再冒出 cdp信息。
下一步我们试试用 vpcs 做终端。
:-
用 GNS3 做CCNA网络实验(6)
9. 路由实验: OSPF
OSPF 路由协议的优点是,它是由 IETF 领导的,不是Cisco的专有协议,因此为多数硬件路由器厂家广泛使用,而且,软件路由器(例如:Vyatta,Zebra 等)就以OSPF协议为主。所以,学习和理解OSPF的配置是很有用处的。
(1) 准备实验
我们假定是关闭 GNS3 后重新打开 GNS3 开始新的实验。
先为这次实验准备一个子目录,例如 在 gns3Project 下建一个子目录 ospf1.
在 GNS3 打开我们以前保存的已经测试过的 topology, 例如 router1.net 然后装入配置文件。
在 GNS3 菜单 File -> Save topology as 把这个 topology 改名为 ospf1.net 并保存 到 ospf1 子目录下。
在 菜单 File -> Import/Export 选 Export to a directory 把原来的配置卸出到子目录 ospf1 下。
这样,下面的实验所用到的 topology 和配置文件均保存在这个子目录下。
在这个实验,我们假定 OSPF 的 process ID 是 1, 而 area 是 0.
现在 启动各个路由器 (R1,R2,PC1,和 PC2),并打开各个 控制台 Console。
(2) 查看路由协议配置前的路由信息
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#show ip route
R1#show ip route
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R2#show ip route
R2#show ip route
(3) 配置路由器
R1:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 1
R1(config-router)#network 192.168.100.0 0.0.0.255 area 0
R1(config-router)#network 172.17.1.0 0.0.0.3 area 0
R1(config-router)#^Z
R1#
R1#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
*Mar 1 00:13:45.819: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.110.253 on Serial2/0 from LOADING to FULL, Loading Done
R1#
R1# R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router ospf 1 R1(config-router)#network 192.168.100.0 0.0.0.255 area 0 R1(config-router)#network 172.17.1.0 0.0.0.3 area 0 R1(config-router)#^Z R1# R1#copy runn start Destination filename [startup-config]? Building configuration... [OK] R1# *Mar 1 00:13:45.819: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.110.253 on Serial2/0 from LOADING to FULL, Loading Done R1#
![](http://dl.iteye.com/upload/attachment/499374/a260d647-3b9d-3b78-a479-e7db3fea4fe9.png)
R2:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#network 192.168.110.0 0.0.0.255 area 0
R2(config-router)#network 172.17.1.0 0.0.0.3 area 0
R2(config-router)#^Z
R2#
*Mar 1 00:13:43.179: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:13:44.195: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.100.254 on Serial2/1 from LOADING to FULL, Loading Done
R2#copy runn start
Destination filename [startup-config]?
Building configuration...
[OK]
R2#
R2# R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#network 192.168.110.0 0.0.0.255 area 0 R2(config-router)#network 172.17.1.0 0.0.0.3 area 0 R2(config-router)#^Z R2# *Mar 1 00:13:43.179: %SYS-5-CONFIG_I: Configured from console by console R2# *Mar 1 00:13:44.195: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.100.254 on Serial2/1 from LOADING to FULL, Loading Done R2#copy runn start Destination filename [startup-config]? Building configuration... [OK] R2#
![](http://dl.iteye.com/upload/attachment/499376/62c96cc6-18d8-3259-bbea-9c03a66d762d.png)
(4) 测试
从 PC1 ping
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
PC1>ping 192.168.110.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 432/773/1872 ms
PC1>ping 192.168.110.22
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 596/792/892 ms
PC1>
PC1>ping 192.168.110.253 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.253, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 432/773/1872 ms PC1>ping 192.168.110.22 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.110.22, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 596/792/892 ms PC1>
从 PC2 ping
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
PC2>ping 192.168.100.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 812/1116/1324 ms
PC2>ping 192.168.100.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1420/1599/1892 ms
PC2>
PC2>ping 192.168.100.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 812/1116/1324 ms PC2>ping 192.168.100.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1420/1599/1892 ms PC2>
(5) 启用路由协议后的路由信息
R1:
![](http://dl.iteye.com/upload/attachment/499387/02072e70-74c9-3ce4-b57f-c70394b532fa.png)
R2:
![](http://dl.iteye.com/upload/attachment/499389/8c204b8c-1902-3569-b6eb-1d4b0cf73fc0.png)
(6) 关闭 cdp 信息
在我们的 topology 中, 由于 R1 和 R2 连接局域网段的是 Ethernet 口, 而 PC1 和 PC2 则是 FastEthernet 口,所以在控制台不断冒出 CDP 信息:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
%CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethernet1/0 (not full duplex), with PC1 FastEthernet0/0 (full duplex).
%CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethernet1/0 (not full duplex), with PC1 FastEthernet0/0 (full duplex).
这信息对路由器设置和使用没有影响,但对阅读控制台的信息输出就造成混乱。关闭这个信息:
C代码
![](http://kingsz1.iteye.com/images/icon_copy.gif)
![](http://kingsz1.iteye.com/images/icon_star.png)
![](http://kingsz1.iteye.com/images/spinner.gif)
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e1/0
R1(config-if)#no cdp enable
R1(config-if)#^Z
R1#
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int e1/0 R1(config-if)#no cdp enable R1(config-if)#^Z R1#
在 R1 和 R2 输入如上类似的设置(端口要按实际连接来定),之后控制台就不再冒出 cdp信息。
下一步我们试试用 vpcs 做终端。
:-
相关文章推荐
- 用 GNS3 做CCNA网络实验(3)
- 用 GNS3 做CCNA网络实验(4)
- 用 GNS3 做CCNA网络实验(1)
- 用 GNS3 做CCNA网络实验(2)
- 用 GNS3 做CCNA网络实验(3)
- 用 GNS3 做CCNA网络实验(4)
- 用 GNS3 做CCNA网络实验(5)
- 用 GNS3 做CCNA网络实验(7)
- 用 GNS3做CCNA网络实验(1)
- CCNA网络系列实验(1)之GNS3安装配置指南
- 用 GNS3 做CCNA网络实验(2)
- 2008微思网络CCNA实验手册
- CCNA(新版)-ipv6网络中启用-ospfv3路由协议配置实验
- CCNA实验3.使用rip协议使网络中的设备能全部通信:
- CCNA实验之:网络地址转换(NAT)实验
- CCNA基础实验:配置帧中继网络
- CCNA网络技术实验手册:Cisco IOS备份与升级
- CCNA网络系列实验(2)之PAP验证方式的配置
- CCNA640-802最新实验题解析-RIPv2网络设计
- 第2章 GNS3和PacketTracer网络模拟器(2)_搭建GNS3实验环境