昨天做的是靜态路由的配置,按照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
%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)#exit
router1#copy running startup
Destination filename [startup-config]?
Building configuration...
[OK]
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
r2 的配置:
Router(config)#interface s0
Router(config-if)#ip address 192.168.2.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#interface e0
Router(config-if)#ip address 192.168.3.1 255.255.255.0
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
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
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
Ping statistics for 192.168.3.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
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
Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
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
Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
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
Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
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
Ping statistics for 192.168.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
pc2的配置:
C:>ipconfig /ip 192.168.3.2 255.255.255.0
C:>ipconfig /dg 192.168.3.1
C:>ping 192.168.1.1 //正式開始檢測,顯示實驗完全成功
C:>
預設路由的配置就到此成功了,總結一下,關鍵語句是:
ip route 0.0.0.0 0.0.0.0 下一跳IP位址,希望大家都能實驗成功!
本文轉自 victoryan 51CTO部落格,原文連結:http://blog.51cto.com/victoryan/38599