使用DynamipsGUI和Vmware搭建廣域網測試環境

學過CISCO的朋友都應該知道DynamipsGUI,這個東西着實強大,再加上Vmware,我們可以很輕鬆的搭建一個完美的測試環境,當然,這需要一個強大性能的機器做後盾。

 

1.       實驗拓撲:
 
 
在這個實驗中,我使用使用三臺Cisco路由器R1R2,和R3,將R3和虛擬機通過橋接的方式連接起來,將R1和我本機的本地連接的網卡橋接起來連入InterNET,然後在三臺路由器上面運行動態路由協議,同時在R1上,因爲我沒有R1的上行鏈路的控制權,所以要使得虛擬機能連到外網,我還需要在R1在做NAT
 
2 實驗材料準備:

 

a.  DynamipsGUI 2.83未註冊版
b.  Vmware 6.03
c.  本機配置: CPU 酷睿2 T7300  4M 2級緩存;2G內存;預裝Windows XP SP3

 

3.實驗環境搭建:

 

a.  安裝Vmware 6.03  默認安裝即可,如果之前安裝過,本過程可以跳過。
b.  Vmware 上新建虛擬機,我採用Windows 2003 SP2 Enterprise Edition。需要注意的是該虛擬機的網卡設置請選擇“Custom”,如下圖:
 
 
c. 使用DynamipsGUI搭建網絡環境:
1)打開DynamipsGUI,路由器個數選3個,交換機個數0,旋轉橋接到PC,設備類型選3640,關於DynamipsGUI的使用方法我不做介紹,學過Cisco的朋友應該都瞭解。
2PC橋接參數配置”裏面,我們需要將R1R3fa1/0接口橋接到本機相應的網卡上面。
橋接之前我把本機上面不需要的網卡全部禁用,只留“Local Area Connection”和“VMware Network Adapter VMnet1”(本實驗只會用到這兩個網卡),注意這點很只要,不然在計算橋接參數的時候會比較麻煩。
關於橋接的具體步驟如下:
在“PC橋接參數配置”下面選中“NIC-0”,然後點擊“計算橋接參數”,在彈出的DOS窗口中找到本機網卡的參數,然後複製下來,我的本機的本地連接的網卡參數是“\Device\NPF_{3F673D56-8DA6-417A-84CD-8D3881BDB707}”,然後粘貼到空白處,點擊:“確定橋接參數”。此步截圖如下:
 

 

    同樣按照上面的步驟選擇“NIC-1”,計算VMware Network Adapter VMnet1的參數,然後填上去點確定。此步截圖如下:

 

 

3.DynamipsGUI模塊設置:
因爲R1R3需要橋接到相應的網卡上去,所以R1R3個需要兩個以太網端口,路由器之間的連接我們採用廣域網的串口。R1R2R3的模塊選擇如下圖:

 

R1的配置:
 
 
R2的配置:
 
 

 

R3的配置:
 
 
 
4.端口連接設置:
Router1 F1/0 <----> XPC P0/0
Router1 S0/0 <----> Router2 S0/0
Router1 S0/1 <----> Router3 S0/1
Router2 S0/2 <----> Router3 S0/2
Router3 F1/0 <----> XPC P0/1
   
完成後生成 .BAT文件即可。
至此,我們基本完成了實驗環境的搭建。

 

 
 
4.網絡配置:

   
(1)       啓動虛擬機的Windows 2003 和三臺路由器。

 

(2)       設置虛擬機的IP地址:
IP地址: 202.103.100.254
子網掩碼:255.255.255.0
默認網關:202.103.100.1
DNS    202.103.24.68   (武漢電信的DNS

 

(3)       配置R3
r3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r3(config)#int fa1/0
r3(config-if)#ip add 202.103.100.1 255.255.255.0
r3(config-if)#no shu
r3(config-if)#exit
r3(config)#int s0/1
r3(config-if)#ip add 202.103.13.3 255.255.255.0
r3(config-if)#no shu
r3(config-if)#exit
r3(config)#int s0/2
r3(config-if)#ip add 202.103.23.3 255.255.255.0
r3(config-if)#no shu
r3(config-if)#exi
r3(config-if)#exit
r3(config)#
r3(config)#do ping 202.103.100.254

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.103.100.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/31/56 ms
r3(config)#

 

(4)       配置R2
r2#conf t
r2(config)#int s0/0    
r2(config-if)#ip add 202.103.12.2 255.255.255.0
r2(config-if)#no shu
r2(config-if)#exit
r2(config)#int s0/2
r2(config-if)#ip add 202.103.23.2 255.255.255.0
r2(config-if)#no shu
r2(config-if)#exit
r2(config)#
r2(config)#do ping 202.103.23.3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.103.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/31/56 ms
r2(config)#

 

(5)       配置R1
r1#conf t
r1(config)#int fa1/0
r1(config-if)#ip add 172.16.20.254 255.255.255.0
r1(config-if)#no shu
r1(config-if)#exit
r1(config)#int s0/0
r1(config-if)#ip add 202.103.12.1 255.255.255.0
r1(config-if)#no shu
r1(config-if)#exit
r1(config)#int s0/1
r1(config-if)#ip add 202.103.13.1 255.255.255.0
r1(config-if)#no shu
r1(config-if)#exit
r1(config)#
r1(config)#do ping 202.103.12.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.103.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/31/56 ms
r1(config)#do ping 202.103.13.3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.103.13.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/55/140 ms
r1(config)#do ping 172.16.20.1

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/19/40 ms
r1(config)#

 

(6)       在上面的Ping測試都通過以後再來在路由器上面運行動態路由協議。這裏我選OSPFR1R2R3上面的配置如下:
a.配置R1
r1(config)#router ospf 1
r1(config-router)#router-id 1.1.1.1
r1(config-router)#net 202.103.12.1 0.0.0.0 a 0
r1(config-router)#net 202.103.13.1 0.0.0.0 a 0
r1(config-router)#exit
r1(config)#

 

需要注意的是在R1上面配置OSPF時不要宣告172.16.20.0 網絡。

 

B.配置R2
r2(config)#router ospf 1
r2(config-router)#router-id 2.2.2.2
r2(config-router)#net 202.103.12.2 0.0.0.0 a 0
r2(config-router)#net 202.103.23.2 0.0.0.0 a 0
r2(config-router)#exit
r2(config)#

 

c.配置R3
r3(config)#router ospf 1
r3(config-router)#router-id 3.3.3.3
r3(config-router)#net 202.103.13.3 0.0.0.0 a 0    
r3(config-router)#net 202.103.23.3 0.0.0.0 a 0
r3(config-router)#exit
r3(config)#

 

(7)       測試上面的配置:
在虛擬機上面ping R1,結果截圖如下:
 
 
 
(1)       完成最後一步,也是最重要的一步——在R1上面做NAT,使得虛擬機能夠連入外網。配置如下:

 

r1#conf t
r1(config)#access-list 15 permit 202.103.0.0 0.0.255.255
r1(config)# ip nat inside source list 15 interface FastEthernet1/0 overload
r1(config)#inter s0/0
r1(config-if)#ip nat inside
r1(config-if)#exit
r1(config)#inter s0/1
r1(config-if)#ip nat inside
r1(config-if)#exit
r1(config)#int fa1/0
r1(config-if)#ip nat outside
r1(config-if)#exit
r1(config)#

 

另外,我們還需要一條到達公網的默認路由:
r1(config)#ip route 0.0.0.0 0.0.0.0 fa1/0 172.16.20.1

 

最後,我們還需要將這條默認路由充分發到OSPF中去:

 

r1(config)#router ospf 1
r1(config-router)#default-information originate always metric 10
r1(config-router)#exit
r1(config)#

 

完成上面的步驟後,再到虛擬機測試。由於我本機所在的局域網是經過防火牆出去的,它把ICMP報文都過濾掉了,我就不Ping了,用IE能成功打開Baidu.com

 

5.實驗總結

 

這個實驗只是搭建搭建一個測試的環境,相當於告訴大家一個思路,至於基於這個環境可以做什麼,比如***等什麼的,那就有待大家去發揮哦,下一步我會再設計一些基於這個環境的實驗。

 

 

                                 By  PPENG   QQ165293302
                                                                                         
 
 
本實驗平臺基於 DynamipsGUI 2.83 未註冊版,感謝小凡

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章