昨天做的是静态路由的配置,按照Boson NetSim上面写的实验计划,后面还有一系列的实验,如下图所示: 昨天做的就是Laber4 静态路由的配置,今天则是Laber5,默认路由的配置,还是和昨天一样,我把关键语句的意思即理解写在了这些语句的后面,下面是我的配置情况: 拓扑图还是昨天那幅图:
具体配置如下:
r1的配置:
Press Enter to Start
Router> Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname router1 router1(config)#interface e0 router1(config-if)#ip address 192.168.1.2 255.255.255.0 router1(config-if)#no shut %LINK-3-UPDOWN: Interface Ethernet0, changed state to up router1(config-if)#interface s0 router1(config-if)#ip address 192.168.2.1 255.255.255.0 router1(config-if)#clock rate 6400 router1(config-if)#no shut %LINK-3-UPDOWN: Interface Serial0, changed state to up router1(config-if)#exit %LINK-3-UPDOWN: Interface Serial0, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.1 router1(config)#ip classless ^ % Invalid input detected at '^' marker. //可能是路由器型号太低或者是模拟软件的bug,ip classless无效 router1(config-if)#exit
router1(config)#exit router1#copy running startup Destination filename [startup-config]? Building configuration... [OK] %LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up r2 的配置:
Press Enter to Start
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface s0 Router(config-if)#ip address 192.168.2.2 255.255.255.0 Router(config-if)#no shut %LINK-3-UPDOWN: Interface Serial0, changed state to up Router(config-if)#interface e0 Router(config-if)#ip address 192.168.3.1 255.255.255.0 Router(config-if)#no shut %LINK-3-UPDOWN: Interface Ethernet0, changed state to up Router(config-if)#exit Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2 Router(config)#exit Router#copy running startup Destination filename [startup-config]? Building configuration... [OK] Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname router2 //不好意思,刚开始忘了设主机名了 router2(config)#exit router2#ping 192.168.1.2 //先试ping下路由,显示成功 Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms pc1的配置:
Boson BOSS 5.0
Copyright 1998-2003 Boson Software, Inc. Use the command help to get started Press Enter to begin
C:>ipconfig /ip 192.168.1.1 255.255.255.0 C:>ipconfig /dg 192.168.1.2 C:>ping 192.168.3.2 //开始测试,显示完全成功 Pinging 192.168.3.2 with 32 bytes of data: Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241 Reply from 192.168.3.2: bytes=32 time=60ms TTL=241 Reply from 192.168.3.2: bytes=32 time=60ms TTL=241 Reply from 192.168.3.2: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.3.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data: Reply from 192.168.3.1: bytes=32 time=60ms TTL=241
Reply from 192.168.3.1: bytes=32 time=60ms TTL=241 Reply from 192.168.3.1: bytes=32 time=60ms TTL=241 Reply from 192.168.3.1: bytes=32 time=60ms TTL=241 Reply from 192.168.3.1: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.3.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data: Reply from 192.168.2.2: bytes=32 time=60ms TTL=241
Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.2.1
Pinging 192.168.2.1 with 32 bytes of data: Reply from 192.168.2.1: bytes=32 time=60ms TTL=241
Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.2: bytes=32 time=60ms TTL=241
Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data: Reply from 192.168.1.1: bytes=32 time=60ms TTL=241
Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms pc2的配置:
Boson BOSS 5.0
Copyright 1998-2003 Boson Software, Inc. Use the command help to get started Press Enter to begin
C:>ipconfig /ip 192.168.3.2 255.255.255.0 C:>ipconfig /dg 192.168.3.1 C:>ping 192.168.1.1 //正式开始检测,显示实验完全成功 Pinging 192.168.1.1 with 32 bytes of data: Reply from 192.168.1.1: bytes=32 time=60ms TTL=241
Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Reply from 192.168.1.1: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data: Reply from 192.168.1.2: bytes=32 time=60ms TTL=241
Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.2.1
Pinging 192.168.2.1 with 32 bytes of data: Reply from 192.168.2.1: bytes=32 time=60ms TTL=241
Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Reply from 192.168.2.1: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data: Reply from 192.168.2.2: bytes=32 time=60ms TTL=241
Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Reply from 192.168.2.2: bytes=32 time=60ms TTL=241 Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>
默认路由的配置就到此成功了,总结一下,关键语句是:
ip route 0.0.0.0 0.0.0.0 下一跳IP地址,希望大家都能实验成功!
------------------------ 网友留言评论: 最近我可是经常关注你的博客啊,希望你有更多的好文章可以让我们学习,昨天我也试了试路由器的配置,不错喔,这个实验我也得马上试一试。 呵呵 ,谢谢关注,我也经常见你在我的博客上留言,你有没有注册一个51cto博客呢?如果没有注册的话,那就赶快注册一个吧,这里真的很好,这里有很多爱好网络技术的朋友和技术大牛喔~~~ 不错。通过这个实验博主可以在扩展的谈谈路由器是如何从路由表上进行选路的。可以把R1和R2的路由表列出来给我们看的话会更直观。 恩,好的,下次我写的时候会把路由表列出来的,呵呵。 为什么可以设置两个默认路由啊,好想只可以设置一个。 跟住你的做了一遍,发觉有一丁点小错误。PC1的配置那里,一来就Ping PC2的IP,P2这时还没配置呢~~你这个系列写得不错,我正打算跟着所有做一遍~~ 我觉得R1的下一个接口路由地址应该是 默认路由的配置就到此成功了,总结一下,关键语句是: 10楼的说的很对,我试验过了。按照你说的可以成功。 (作者:victoryan 来自:Keep Moving博客 ) |
不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流
GMT+8, 2025-8-21 01:05 , Processed in 0.065459 second(s), 15 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.