我在 VirtualBox 上的 Oracle Linux 6.4 上运行了一个 Web 服务器。它eth1
的地址是10.0.2.15
。我希望能够从这个虚拟机运行 Web 服务器,但我无法从主机访问虚拟机。客户操作系统也无法访问互联网;我无法 ping 通 Google。
目前虚拟机设置中的网络适配器配置为NAT。以下是文件/etc/sysconfig/network-scripts/ifcfg-eth1
:
DEVICE=eth1
TYPE=Ethernet
#UUID=47fc2dd9-bca4-4912-95b5-7939b3e0ebf5
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
HWADDR=08:00:27:06:9c:d5
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
LAST_CONNECT=1392385849
我需要如何在虚拟机设置和客户操作系统中配置网络?
编辑
ifconfig:
# ifconfig
eth1 Link encap:Ethernet HWaddr 08:00:27:06:9C:D5
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe06:9cd5/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3731 (3.6 KiB) TX bytes:6688 (6.5 KiB)
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:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)
virbr0 Link encap:Ethernet HWaddr 52:54:00:B9:22:2C
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)