I'm running VirtualBox 4.0.8 on openSUSE 11.4 with an Ubuntu Server 11.04 and CentOS5 guests. I am trying to setup a virtual server setup to test some things out, the CentOS guest is going to be a DHCP and DNS server for the Ubuntu guest. Both guests have two NICs, one set as NAT for internet access and one set as Internal Network that is to be the network the VMs communicate with. I can't seem to get DHCP to work though. I set CentOS with a static IP, set it to use eth1 (internal network) as the listening device, configured dhcpd.conf, etc, and I have Ubuntu's eth1 set to DHCP, but it will not get an address (tried dhclient and restarting). If I set Ubuntu with a static IP I can ping CentOS, so it seems there is a connection between the VMs. I'm not that experienced with DHCP set up especially between VMs, so I could definitely be doing something wrong. I will post the dhcpd.conf file and if there are any other files/command outputs you would like to see please let me know.
[root@localhost etc]# cat dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#ddns-update-style interim;
ignore client-updates;
subnet 10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
#option routers 192.168.0.1;
option broadcast-address 10.0.0.255
option subnet-mask 255.255.255.0;
#option nis-domain "domain.org";
#option domain-name "domain.org";
option domain-name-servers 127.0.0.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 10.0.0.2 10.0.0.10;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
#host ns {
next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
#}
}
DHCP between VMs
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: DHCP between VMs
I would have used a different range, as it might cause problems with VB's own 10.0.2.x/24 range. Even though it shouldn't, it can happen (we are talking about computers, mysterious things keep happening with them). Something you can do to test the actual request and offer, is run tcpdump on both machines, listening to the internal network, then do a dhclient on it. You should also have a log file of dhcpd, it might have some useful information in it to solve this.
Lastly, change the dns server to the actual IP of the server, instead of pointing to localhost. The clients will have that as dns server too and will fail to resolve addresses because it's not a DNS server on it's own.
I know that this has to work, so it sounds more like a config error than an issue with VB. We'll see once you've got the output of the above.
Lastly, change the dns server to the actual IP of the server, instead of pointing to localhost. The clients will have that as dns server too and will fail to resolve addresses because it's not a DNS server on it's own.
I know that this has to work, so it sounds more like a config error than an issue with VB. We'll see once you've got the output of the above.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.