Get IP from DHCP server from other machine in Internal Network

2

I have two virtual machines:

  1. Debian (Router) with one Bridged Adapter and three Internal Network adapters
  2. Ubuntu with one Internal Network adapter

I installed on Debian DHCP server, I'd like Ubuntu machine to get IP address from the DHCP server that is installed on Debian. But it is not working.

My configuration files:

Debian

/etc/network/interfaces

#   The loopback network interface auto lo
iface lo inet loopback

#   The primary network interface allow-hotplug eth0
iface eth0 inet dhcp

#   servers
auto eth1
iface eth1 inet
static address 192.168.1.1
netmask 255.255.255.0

#   administration auto eth2

iface eth2 inet
static address 192.168.2.1
netmask 255.255.255.0

#   hotel guests
auto eth3
iface eth3 inet
static address 192.168.3.1 
netmask 255.255.255.0

And /etc/dhcp/dhcpd.conf

subnet 192.168.3.0 netmask 255.255.255.0 {
   eth3;
   range 192.168.3.2 192.168.3.254;
   option routers 192.168.3.1;
   option domain-name-servers 192.168.1.2;
}

restart dhcp and networking - no error

Ubuntu machine:

/etc/network/interfaces

auto lo 
iface lo inet loopback

auto eth1
iface eth1 inet dhcp

next, service networking restart I get this message:

enter image description here

IP address is not assigned. Why? Give more information?

lukassz

Posted 2015-12-27T11:52:45.487

Reputation: 230

any ideas guys? – lukassz – 2015-12-27T16:08:14.060

Answers

1

How do you know that the NIC eth3 is attached to the same internal network as your Ubuntu Guest? Because of problems in NIC naming, you might very well have that eth3 is attached to a different internal network than your Ubuntu VM.

One way to solve this is to have your DHCP server listening on all internal interfaces, then the Ubuntu VM would probably get a DHCP offer.

Another solution is to specify, for the 4 adapters of the Debian VM, four different hardware implementations, then write appropriate udev rules to attach them to the appropriate names, eth1, eth2, eth3.

MariusMatutiae

Posted 2015-12-27T11:52:45.487

Reputation: 41 321

Ok, thanks for answer. How to put DHCP server to listen on all internal interfaces? – lukassz – 2016-01-05T09:40:02.583

@lukassz Which DHCP server are you using? Dnsmasq? Isc-dhcp-server? – MariusMatutiae – 2016-01-05T09:43:31.430

Isc-dhcp-server – lukassz – 2016-01-05T09:53:33.737

@lukassz Then modify the file /etc/default/isc-dhcp-server to contain a line like INTERFACES="eth1 eth2 ...". – MariusMatutiae – 2016-01-05T10:06:09.757

I do not mind it at this on eth1, eth2 (debian machine) addresses are set static? – lukassz – 2016-01-05T10:18:12.227

@lukassz No, no problem at all. – MariusMatutiae – 2016-01-05T10:51:52.877