实现GNS的模拟路由器连接Internet
1、环境: XP 系统,GNS3.0.7.2 集成SecureCRT(也可以没有SecureCRT)
准备:在XP系统下添加Loopback adapter 虚拟网卡 ,一个ADSL拨号连接
2、网络连接配置:
7、选中R1然后按右键,单击“开始“,接着在选中R1按右键,单击“Console”出现与GNS集成的SecureCRT配置控制台(如果没有集成SecureCRT的话会出现一个dos一样的控制台):
3、接着打开运行,输入services.msc出现如下界面:
然后找到下面服务,并确定这些服务已启动,否则设置他们为已启动。
DHCP Client 设为已启动
DNS Client 设为已启动
Windows Firewall / Internet Connection Sharing(ICS) 设为已启动.
4、打开网络连接,双击“宽带连接勾上”任何使用此计算机的人“接着填上密码,然后,选择“属性”然后选择“高级“ 进行设置:
完成设置后查看网络连接变化:
5、完成以上步骤后打开GNS3.0.7.2构建拓扑如下:
配置Cloud “Loopback”,右键单击“Loopback”选择“配置“,按顺序进行以下操作即可:
进行设备连接,单击GNS的工具栏的“添加连接”按钮,接着用鼠标把设备连接,接着再按“show interface names”按钮,如下图:
6、选中R1然后按右键,单击“开始“,接着在选中R1按右键,单击“Console”出现与GNS集成的SecureCRT配置控制台(如果没有集成SecureCRT的话会出现一个dos一样的控制台):
7、在SecureCRT里对R1进行配置.命令如下: Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#host R1 R1(config)#enable pass cisco R1(config)#line con 0 R1(config-line)#pass cisco R1(config-line)#login R1(config-line)#logg synchronous R1(config-line)#no exec-timeout R1(config-line)#line vty 0 15 R1(config-line)#pass cisco R1(config-line)#login R1(config-line)#logg syn R1(config-line)#no exec-timeout R1(config-line)#exit R1(config)#int fa0/0 R1(config-if)#ip add 192.168.0.2 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# *Mar 1 00:05:53.659: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 1 00:05:54.659: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)#end R1# *Mar 1 00:07:06.071: %SYS-5-CONFIG_I: Configured from console by console R1#ping 192.168.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 24/41/48 ms R1# 8、测试ping外网发现失败: R1#ping www.baidu.com Translating "www.baidu.com"...domain server (255.255.255.255) % Unrecognized host or address, or protocol not running. R1#ping google.com Translating "google.com"...domain server (255.255.255.255) % Unrecognized host or address, or protocol not running. R1# 9、添加缺省路由 R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1 R1(config)#exit
10、最后测试成功:
R1#ping www.baidu.com
Translating "www.baidu.com"...domain server (255.255.255.255) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 220.181.6.18, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/96/120 ms
R1#ping www.google.com
Translating "www.google.com"...domain server (255.255.255.255) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 66.249.89.104, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/105/144 ms