我有一個在 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
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)