虚拟网卡的创建文件
/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) TX bytes:19855910 (19.8 MB)
tap0 Link encap:Ethernet HWaddr 4e:1d:08:17:33:35
inet6 addr: fe80::4c1d:8ff:fe17:3335/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:13466 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tap1 Link encap:Ethernet HWaddr 1a:15:aa:84:0b:c6
inet6 addr: fe80::1815:aaff:fe84:bc6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:13467 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
virbr0 Link encap:Ethernet HWaddr ee:7b:cc:04:e0:c3
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::ec7b:ccff:fe04:e0c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1383 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:151088 (151.0 KB)
virbr1 Link encap:Ethernet HWaddr b6:a1:16:8b:67:45
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::b4a1:16ff:fe8b:6745/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1378 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:150611 (150.6 KB)
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:192.168.65.1 Bcast:192.168.65.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:594 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:172.16.55.1 Bcast:172.16.55.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1189 errors:0 dropped:0 overruns:0 frame:0
TX packets:2275 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)