How to configure a Linux DHCP server when behing a DHCP relay?

0

Considere the following:

enter image description here

How can I configure my DHCP server (isc-dhcp-server package on ubuntu) to feed addresses for 172.16.0.0/18 subnet as it does not has any interface in that subnet? I tried to configure a loopback inside that range to trick the service, but it does not work.

# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 172.16.0.1/18 scope global lo:10
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 94:c6:91:ab:68:d0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.111.14/30 brd 192.168.111.15 scope global enp3s0


# cat dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
option domain-name-servers 8.8.8.8, 1.1.1.1;
option domain-name "thankForYourHelp.stackoverflow";
authorative;

subnet 172.16.0.0 netmask 255.255.192.0 {
  range 172.16.0.100 172.16.0.150;
  option subnet-mask 255.255.192.0;
  option domain-name-servers 8.8.8.8, 1.1.1.1;
  option routers 172.16.0.1;
  get-lease-hostnames true;
  use-host-decl-names true;
  default-lease-time 600;
  max-lease-time 7200;
}


# cat /etc/default/isc-dhcp-server
INTERFACESv4="lo"
INTERFACESv6=""

Thank you for your help.

Nakrule

Posted 2019-07-09T12:24:59.167

Reputation: 101

Answers

1

I figured it out. To do this a shared network with combined pools need to be created in the dhcp.conf file. This will be as follows where the first subnet is the one that is not directly connected to your dhcp server, and then add other subnets that do not have any options defined that match your interface addresses.

shared-network Combined-pools {
subnet 10.0.0.0 netmask 255.255.0.0 {
  range 10.0.0.10 10.0.200.200;
  option subnet-mask 255.255.0.0;
  option routers 10.0.0.1;

option domain-name-servers 8.8.8.8, 8.8.4.4;
}

subnet 192.168.120.0 netmask 255.255.255.0 {
}

}

user1111928

Posted 2019-07-09T12:24:59.167

Reputation: 11