标签:vm虚拟机 nat上网 网卡设备驱动 vmware fedora ping
如果你已经看完 VMware 的网络配置详解(一) 的话,现在继续来深入理解;
首先在 windows 系统下 使用cmd 程序, 通过使用 ping 命令,ping 一个
可以连接的 外网 主机名 或者 IP 地址:
然后在 fedora15 系统上 ping 同样的主机名:
应该是和网络设置的 类型有关; 我的网卡都是设置 Host-only 的方式;
所以为了使 fedora15 能够 ping 的通主机地址 ,我们来设置下张新的
网卡,但是不使用 Host-only 方式,使用 NAT 方式;
① 增加网卡 VMnet8 :
② 为fedora 15 配置网卡 Vmnet8
现在我们看一下 fedora 的网卡信息(发现 多了 eth3 网卡 ):
[root@localhost /]# [root@localhost /]# ifconfig br0 Link encap:Ethernet HWaddr 00:0C:29:99:0E:04 inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe99:e04/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7047041 errors:0 dropped:0 overruns:0 frame:0 TX packets:10172976 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1154188585 (1.0 GiB) TX bytes:10407590882 (9.6 GiB) br1 Link encap:Ethernet HWaddr 00:0C:29:99:0E:0E inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::58f6:69ff:fef0:b3db/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2538 errors:0 dropped:0 overruns:0 frame:0 TX packets:3063 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:251946 (246.0 KiB) TX bytes:301190 (294.1 KiB) eth0 Link encap:Ethernet HWaddr 00:0C:29:99:0E:04 inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe99:e04/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3163 errors:0 dropped:0 overruns:0 frame:0 TX packets:3074 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:827602 (808.2 KiB) TX bytes:586661 (572.9 KiB) Interrupt:19 Base address:0x2024 eth1 Link encap:Ethernet HWaddr 00:0C:29:99:0E:0E inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe99:e0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:388 errors:0 dropped:0 overruns:0 frame:0 TX packets:248 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:34813 (33.9 KiB) TX bytes:36708 (35.8 KiB) Interrupt:17 Base address:0x2424 eth2 Link encap:Ethernet HWaddr 00:0C:29:99:0E:18 inet addr:192.168.2.101 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe99:e18/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:138 errors:0 dropped:0 overruns:0 frame:0 TX packets:124 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14219 (13.8 KiB) TX bytes:18435 (18.0 KiB) Interrupt:19 Base address:0x24a4 eth3 Link encap:Ethernet HWaddr 00:0C:29:99:0E:22 inet addr:192.168.140.128 Bcast:192.168.140.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe99:e22/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1048 (1.0 KiB) TX bytes:4002 (3.9 KiB) Interrupt:16 Base address:0x2824 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:1254 errors:0 dropped:0 overruns:0 frame:0 TX packets:1254 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:114658 (111.9 KiB) TX bytes:114658 (111.9 KiB) [root@localhost /]#
现在在 ping 一下主机地址试试:
VM 下 fedora 系统设置网卡就先这样;以上方式增加的网卡,
仅仅是针对该设备驱动(vmxnet):
[root@localhost /]# [root@localhost /]# ethtool -i eth0 driver: vmxnet version: 2.0.15.0 firmware-version: N/A bus-info: 0000:02:01.0 [root@localhost /]# [root@localhost /]#
附:
其实还有其他的方式 增加网卡 :
在 fedora15 该 /dev/net/ 路径下有 tun 的设备驱动,我们也可以
通过该设备驱动增加 网卡;
。。。。。。
标签:vm虚拟机 nat上网 网卡设备驱动 vmware fedora ping
原文地址:http://blog.csdn.net/u010616985/article/details/45076479