GNS3模拟路由配置综合实验

实验环境

理论之前的博客已经写过,这次直接实验。

具体拓扑图如下,注意R3接口不够,需要添加两个NM-1FE-TX单板。

GNS3模拟路由配置综合实验GNS3模拟路由配置综合实验

实际操作

配置R1

R1#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0                          //进入接口模式
R1(config-if)#ip add 192.168.10.1 255.255.255.0                         //设置IP地址与子网掩码
R1(config-if)#no shut                     //开启接口
R1(config-if)#
*Mar  1 00:01:35.883: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:01:36.883: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#int f0/1                          //进入接口模式
R1(config-if)#ip add 192.168.20.1 255.255.255.0                         //设置IP地址与子网掩码
R1(config-if)#no shut                     //开启接口
R1(config-if)#
*Mar  1 00:01:59.307: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:02:00.307: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config-if)#exit                            //退出
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.2                         //添加默认路由
R1(config)#

配置R2

R2#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/0                          //进入接口模式
R2(config-if)#ip add 192.168.30.1 255.255.255.0                         //设置IP地址与子网掩码
R2(config-if)#no shut                     //开启接口
R2(config-if)#
*Mar  1 00:04:47.727: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:04:48.727: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#int f0/1                          //进入接口模式
R2(config-if)#ip add 192.168.20.2 255.255.255.0                         //设置IP地址与子网掩码
R2(config-if)#no shut                     //开启接口
R2(config-if)#
*Mar  1 00:05:11.091: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:05:12.091: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config-if)#exit                            //退出
R2(config)#router ospf 1               //启用ospf协议,进程号为1
R2(config-router)#router-id 2.2.2.2               //设置router-id
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1                      //宣告网段
R2(config-router)#exit                            //退出
R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1             //添加静态路由
R2(config)#router ospf 1                        //进入ospf 协议
R2(config-router)#redistribute connected subnets                                  //OSPF引入直连网段
R2(config-router)#redistribute static subnets                                           //OSPF引入静态路由
R2(config-router)#exit                            //退出
R2(config)#
*Mar  1 00:16:38.251: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from LOADING to FULL, Loading Done
R2(config)#

配置R3

R3#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int f0/0                          //进入接口模式
R3(config-if)#ip add 192.168.30.2 255.255.255.0                         //设置IP地址与子网掩码
R3(config-if)#no shut                     //开启接口
*Mar  1 00:11:13.671: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:11:14.671: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#int f0/1                          //进入接口模式
R3(config-if)#ip add 192.168.40.1 255.255.255.0                         //设置IP地址与子网掩码
R3(config-if)#no shut                     //开启接口
R3(config-if)#
*Mar  1 00:11:33.875: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:11:34.875: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R3(config-if)#int f1/0                          //进入接口模式
R3(config-if)#ip add 12.0.0.1 255.255.255.0                         //设置IP地址与子网掩码
R3(config-if)#no shut                     //开启接口
R3(config-if)#
*Mar  1 00:11:57.195: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Mar  1 00:11:58.195: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R3(config-if)#int f2/0                          //进入接口模式
R3(config-if)#ip add 192.168.70.1 255.255.255.0                         //设置IP地址与子网掩码
R3(config-if)#no shut                     //开启接口
R3(config-if)#
*Mar  1 00:12:21.339: %LINK-3-UPDOWN: Interface FastEthernet2/0, changed state to up
*Mar  1 00:12:22.339: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/0, changed state to up
R3(config-if)#exit                            //退出
R3(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2                         //添加默认路由
R3(config)#router ospf 1               //启用ospf协议,进程号为1
R3(config-router)#router-id 3.3.3.3               //设置router-id
R3(config-router)#network 192.168.30.0 0.0.0.255 area 1                      //宣告网段
R3(config-router)#
*Mar  1 00:15:28.199: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0                      //宣告网段
R3(config-router)#network 192.168.70.0 0.0.0.255 area 0                      //宣告网段
R3(config-router)#default-information originate                                        //OSPF引入默认路由
R3(config-router)#exit                            //退出
R3(config)#
*Mar  1 00:34:42.595: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on FastEthernet0/1 from LOADING to FULL, Loading Done
R3(config)#

配置R4

R4#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#int f0/0                          //进入接口模式
R4(config-if)#ip add 192.168.40.2 255.255.255.0                         //设置IP地址与子网掩码
R4(config-if)#no shut                     //开启接口
R4(config-if)#
*Mar  1 00:28:15.879: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:28:16.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4(config-if)#int f0/1                          //进入接口模式
R4(config-if)#ip add 192.168.50.1 255.255.255.0                         //设置IP地址与子网掩码
R4(config-if)#no shut                     //开启接口
R4(config-if)#
*Mar  1 00:29:21.695: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:29:22.695: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R4(config-if)#exit                            //退出
R4(config)#router rip                     //启用RIP协议
R4(config-router)#version 2        //使用RIP版本2
R4(config-router)#no auto-summary                         //关闭自动汇总
R4(config-router)#network 192.168.50.0                 //宣告网段
R4(config-router)#redistribute ospf 1 metric 5        //RIP引入OSPF路由
R4(config-router)#exit                            //退出
R4(config)#router ospf 1               //启用ospf协议,进程号为1
R4(config-router)#router-id 4.4.4.4               //设置router-id
R4(config-router)#network 192.168.40.0 0.0.0.255 area 0                 //宣告网段
*Mar  1 00:33:22.651: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from LOADING to FULL, Loading Done
R4(config-router)#redistribute rip subnets                                         //OSPF引入RIP路由
R4(config-router)#exit                            //退出
R4(config)#

配置R5

R5#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#int f0/0                          //进入接口模式
R5(config-if)#ip add 192.168.50.2 255.255.255.0                         //设置IP地址与子网掩码
R5(config-if)#no shut                     //开启接口
R5(config-if)#int f0/1                          //进入接口模式
R5(config-if)#
*Mar  1 00:36:28.747: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:36:29.815: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R5(config-if)#ip add 192.168.60.1 255.255.255.0                         //设置IP地址与子网掩码
R5(config-if)#no shut                     //开启接口
R5(config-if)#
*Mar  1 00:36:57.275: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:36:58.275: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R5(config-if)#exit                            //退出
R5(config)#router rip                     //启用RIP协议
R5(config-router)#version 2        //使用RIP版本2
R5(config-router)#no auto-summary                          //关闭自动汇总
R5(config-router)#network 192.168.50.0                 //宣告网段
R5(config-router)#network 192.168.60.0                 //宣告网段
R5(config-router)#exit                            //退出
R5(config)#

配置R6

R6#conf t                                          //进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R6(config)#int f0/0                          //进入接口模式
R6(config-if)#ip add 12.0.0.2 255.255.255.0                         //设置IP地址与子网掩码
R6(config-if)#no shut                     //开启接口
R6(config-if)#int f0/1                          //进入接口模式
R6(config-if)#
*Mar  1 00:19:13.363: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:19:14.363: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R6(config-if)#ip add 13.0.0.1 255.255.255.0                         //设置IP地址与子网掩码
R6(config-if)#no shut                     //开启接口
R6(config-if)#exit                            //退出
R6(config)#
*Mar  1 00:19:37.803: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:19:38.803: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R6(config)#ip route 192.168.0.0 255.255.0.0 12.0.0.1      //设置默认路由
R6(config)#

分别给PC1、PC2、PC3、PC四(防违禁)设置IP地址

给PC1设置IP地址

PC1> ip 192.168.10.2 192.168.10.1           //设置IP和网关
Checking for duplicate address...
PC1 : 192.168.10.2 255.255.255.0 gateway 192.168.10.1

给PC2设置IP地址

PC2> 
PC2> ip 192.168.70.2 192.168.70.1           //设置IP和网关
Checking for duplicate address...
PC1 : 192.168.70.2 255.255.255.0 gateway 192.168.70.1

给PC3设置IP地址

PC3> 
PC3> ip 13.0.0.13 13.0.0.1           //设置IP和网关
Checking for duplicate address...
PC1 : 13.0.0.13 255.255.255.0 gateway 13.0.0.1

给PC四设置IP地址

PC4> ip 192.168.60.2 192.168.60.1           //设置IP和网关
Checking for duplicate address...
PC1 : 192.168.60.2 255.255.255.0 gateway 192.168.60.1

验证实验结果

分别用PC1去ping其它所有PC机,都能互通,实验成功。

PC1> ping 192.168.70.2
192.168.70.2 icmp_seq=1 timeout
192.168.70.2 icmp_seq=2 timeout
84 bytes from 192.168.70.2 icmp_seq=3 ttl=61 time=93.680 ms
84 bytes from 192.168.70.2 icmp_seq=4 ttl=61 time=93.717 ms
84 bytes from 192.168.70.2 icmp_seq=5 ttl=61 time=93.722 ms

PC1> ping 13.0.0.13
13.0.0.13 icmp_seq=1 timeout
13.0.0.13 icmp_seq=2 timeout
84 bytes from 13.0.0.13 icmp_seq=3 ttl=60 time=124.965 ms
84 bytes from 13.0.0.13 icmp_seq=4 ttl=60 time=124.858 ms
84 bytes from 13.0.0.13 icmp_seq=5 ttl=60 time=125.056 ms

PC1> ping 192.168.60.2
192.168.60.2 icmp_seq=1 timeout
84 bytes from 192.168.60.2 icmp_seq=2 ttl=59 time=156.210 ms
84 bytes from 192.168.60.2 icmp_seq=3 ttl=59 time=157.946 ms
84 bytes from 192.168.60.2 icmp_seq=4 ttl=59 time=166.144 ms
84 bytes from 192.168.60.2 icmp_seq=5 ttl=59 time=156.238 ms

本文地址:https://www.linuxprobe.com/ospf-rip-route.html

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
GNS3配置静态路由的命令如下: 1. 进入全局模式:config terminal 2. 进入接口模式:interface fastethernet 3. 配置IP地址:ip address 4. 开启接口:no shutdown 5. 跨模式查看地址:do show ip interface 6. 跨模式查看路由表:do show ip route 7. 配置网络号:ip route 请注意,这只是静态路由配置的基本命令,具体的配置取决于你的网络拓扑和需求。使用这些命令,你可以为不同的接口配置IP地址,开启接口,并设置静态路由表。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span> #### 引用[.reference_title] - *1* [GNS3静态路由配置](https://blog.csdn.net/bianping4911/article/details/100961174)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* *4* [GNS3静态路由配置实验](https://blog.csdn.net/qq_18704647/article/details/105319785)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [GNS3使用及ip地址规划](https://download.csdn.net/download/weixin_38595850/14049145)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值