- 论坛徽章:
- 0
|
也做过单臂路由的实验,但都是用Boson做的。效果不太理想,老是出现一些莫名奇妙的问题。实在令人抓狂!昨天见阿鹏在做VLAN之间的通信。看了心痒痒的。也做了,折腾了大半天才完成。吼吼。高兴ING。
以前同学写过一个关于Dynamips与VMware做WEB服务器的实验。想想,自己也可以用这个方法做单臂哦,吼吼~
网络拓朴如下:
-----------------------------------------------------------------------------------
![]()
----------------------------------------------------------------------------------
实验环境如下:
DynamipsGUI 2.3 、WinPcap_4_0 VMwrea 6.0
实验要求:LINUX A可以和LINUX B相互通信。
---------------------------------------------------------------------------------
OK,开始啦!
1、
先在真实的PC上安装以上的软件。其中。WinPcap_4_0可以让你的网卡连接到虚拟的路由端口上。
在真实PC上再安装两张 Microsoft Loopback Adapter 网卡(虚拟的)。在添加新硬件上可以添加。
然后让两个LINUX PC 的网卡分别桥接到这两个网卡上。
2、设置虚拟网卡的IP,以及LINUX PC的IP
Microsoft Loopback Adapter 1 IP:10.10.1.20/24 网关:10.10.1.1
Microsoft Loopback Adapter 2 IP:192.168.1.199/24 网关:192.168.1.1
LINUX A 10.10.1.21/24 网关:10.10.1.1
LINUX B 192.168.1.200/24 网关:192.168.1.1
LINUX 的网卡配置文件在 /etc/sysconfig/network-scripts/ 下。对应的一般是eth0或是其他的。
修改相关参数即可!
3、打开DynamipsGUI 2.3。选择3640。并桥接到PC。然后获取网卡对应的桥接参数。
按照上方的拓朴连接各个接口。保存拓朴文件。生成BAT。退出。
启动路由和交换机并进行配置。
Router>enable
Router#confgiure terminal
Router(config)#interface lookback 0
Router(config-if)ip address 1.1.1.1 255.255.255.255
Router(config-if)#interface fastEthernet 1/0
Router(config-if)#no shutdown
Router(config-if)#no ip address
Router(config-if)#interface fastEthernet 1/0.2
Router(config-subif)#no shutdown
Router(config-subif)#encapsulation dot1Q 2
Router(config-subif)#ip address 10.10.1.1 255.255.255.0
Router(config-subif)#interface fastEthernet 1/0.3
Router(config-subif)#no shutdown
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router#copy running-config startup-config
Router#show ip route
如果如下:
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.1.0 is directly connected, FastEthernet1/0.2
C 192.168.1.0/24 is directly connected, FastEthernet1/0.3
路由配置完毕
-------------------------------------------------------------------------------
Switch>
Switch>enbale
Switch#vlan database
Switch(vlan)#vlan 2 name V2
Switch(vlan)#vlan 3 name V3
Switch(vlan)#apply
Switch(valn)#exit
Switch#configure terminal
Switch(config)#interface fastEtehernet 0/10
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dot1Q
Switch(config-if)#interface fastEthernet 0/1
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#interface fastEthernet 0/2
Switch(config-if)#no shutdown
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch#copy running-config startup-config
Switch#show valn-switch
Switch#show vlan-switch
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/0, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15
2 V2 active Fa0/1
3 V3 active Fa0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
2 enet 100002 1500 - - - - - 0 0
3 enet 100003 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
---------------------------------------------------------------------------------
交换配置完毕。
测试:
在Linux A 上可以ping 通 linux B.
![]()
----------------------------------------------------------------------------------
![]()
------------------------------------------------------------------------------
END
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/33768/showart_329454.html |
|