日期:2014-05-16  浏览次数:20674 次

vmware 配置支持多实例互相访问 Linux
虚拟网卡的创建文件
/etc/network/interfaces

//创建虚拟网卡的工具
sudo apt-get install uml-utilities
//用 l 用户创建了 tap0 虚拟网卡
tunctl -t tap0 -u l


文件内容

##########################################
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
 
auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user l

auto tap1
iface tap1 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user l

auto br0
iface br0 inet static
bridge_ports eth0 tap0 tap1
address 192.168.1.3
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.1

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig br0 up # line maintained by pppoeconf
provider dsl-provider


#########################################
// 拷贝img  由于网卡mac 冲突 需要修改Red Hat Enterprise Linux 5 64-bit.vmx
// 文件的ethernet0.address

ethernet0.addressType = "static"
ethernet0.address = "00:50:56:00:00:01"

############################################

虚拟网卡 再 VMX 中手工配置   配置不同的地址,都用bridge 的方法。



主机运行期配置如下:


br0       Link encap:Ethernet  HWaddr 1a:15:aa:84:0b:c6 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::6ef0:49ff:fe06:657e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31479387 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10089608 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:44193358627 (44.1 GB)  TX bytes:556068056 (556.0 MB)

eth0      Link encap:Ethernet  HWaddr 6c:f0:49:06:65:7e 
          inet6 addr: fe80::6ef0:49ff:fe06:657e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20137682 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54571784 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20882371478 (20.8 GB)  TX bytes:46002116411 (46.0 GB)
          Interrupt:41

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:18806 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18806 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:19855910 (19.8 MB)&nbs