Dhcp with VirtualBox problem

asked 2014-11-10 09:36:48 -0500

Jasontw gravatar image

Hello Everyone, My PC has 2 of network adapter(eth0,eth1),and I has installed Fedora 16 with DHCP on it.

eth0 ip:192.168.1.1 / 255.255.255.0

eth1 ip 172.16.1.1 / 255.255.255.0

and I use VirtualBox to install a Windows 7 , its network adapter is bridged to eth1.

Following is my dhcp setting(dhcpd.conf)

ddns-update-style none;         
default-lease-time 43200;       
max-lease-time 86400;       

subnet 172.16.1.0   netmask 255.255.255.0   {
option router 176.16.1.1;
option broadcast-address 176.16.1.255;
range 172.16.1.100 172.16.1.200
}

subnet 192.168.1.0 netmask 255.255.255.0 { }

So I think my Win7 should get IP from subnet-172.16.1.0 by DHCP

But the log indicate DHCP detect Win7 via eth0(192.168.1.1)

If i modify the dhcpd.conf like this:

ddns-update-style none;         
default-lease-time 43200;       
max-lease-time 86400;       

subnet 172.16.1.0 netmask 255.255.255.0 {
option router 176.16.1.1;
option broadcast-address 176.16.1.255;
range 172.16.1.100 172.16.1.200
}

subnet 192.168.1.0 netmask 255.255.255.0 {
option router 192.168.1.1;
option broadcast-address 192.168.1.255;
range 192.168.1.100 192.168.1.200
 }

My Win7 will get 192.168.1.100 by DHCP

Why?

Shouldn't it be detected by eth1? why is eth0 detect it?

And is there any method to make my win7 in virtualbox get IP from subnet-172.16.1.0 by DHCP?

Thanks!

edit retag flag offensive close merge delete