Quantcast
Channel: iT邦幫忙
Viewing all articles
Browse latest Browse all 15645

VirtualBox 如何讓虛擬主機"內部網路"透過NAT方式連上網

$
0
0
以下是設定資料:

以下都是兩台都是虛擬主機,一台centOS6.2當server,另一台win_xp當client端,
1.centOS
eth0(virtualbox-NAT網路):
DEVICE="eth0"
HWADDR="08:00:27:0B:A1:E6
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO=dhcp

eth1(virtualbox內部網路):
DEVICE="eth1"
HWADDR="08:00:27:10:61:87
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO=static
BROADCAST=192.168.100.255
IPADDR=192.168.100.250
NETWORK=192.168.100.0
NETMASK=255.255.255.0

dhcp:
ddns-update-style none;
ignore client-updates;
default-lease-time 259200;
max-lease-time 518400;
option routers 192.168.100.250;
option domain-name "centos.server";
option domain-name-servers 168.95.1.1, 139.175.10.20;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.101 192.168.100.200;

host louis_xp {
hardware ethernet 08:00:27:98:CE:94;
fixed-address 192.168.100.30;
}
}

2.win_xp都是透過dhcp來取得

echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.100.0/24 -j MASQUERADE

由於試了很多東西,還是無法連上!想請問版上資深工程師幫忙解答一下!!這問題卡了我兩天還是試不好,還是我的邏輯上有問題!

Viewing all articles
Browse latest Browse all 15645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>