Nethserver as dhcp relay agent

network
dhcp

(Guillermo Fekete) #1

NethServer Version: 7.4.1708
Module: dhcp

Hi Everyone!

I’m not good speaking English. So, first of all, I apologize for my speaking mistakes…

I’m installing/configurating my first NethServer, and I want it to act as DHCP relay agent (my dhcp server is in orange zone). Is it posible?


(fpausp) #2

I am not sure if it works with another subnet, this costom template works for the green zone…

Make a custom-template on the DHCP-Server:

# make folder for template
mkdir -p /etc/e-smith/templates-custom/etc/dnsmasq.conf/

# create template-file
nano /etc/e-smith/templates-custom/etc/dnsmasq.conf/99fog

# content for 99fog
dhcp-boot=undionly.kpxe,,192.168.xxx.xxx

# expand template
expand-template /etc/dnsmasq.conf

Maybe you have to use this:
dhcp-option=pxe,next-server,192.168.xxx.xxx

Instead of:
dhcp-boot=undionly.kpxe,,192.168.xxx.xxx

I think you need some deeper search… - DNSMASQ DHCP configuration for multiple subnets


(Guillermo Fekete) #3

Hello!
After some tests and research (in debian because is more familiar to me), I’ve read that dhcp-relay doesn’t work in dnsmasq 2.76 and 2.77.

In http://www.thekelleys.org.uk/dnsmasq/CHANGELOG, for 2.78 we read:

“Fix DHCP relaying, broken in 2.76 and 2.77 by commit
ff325644c7afae2588583f935f4ea9b9694eb52e.”

So, I installed and tested dnsmasq 2.79 and it works greate!

Now I’ll try to use it in NS.
Is it posible to upgrade to dnsmasq 2.79 in NS 7.4? (Does CentOS documentation and repositories would help me?)

Or… Where can I see packages version of NS 7.5?

Thanks!


Is bad practice to install DHCP server "in" (not "for") dmz?
(Filippo Carletti) #4

Unfortunately, the answer is more a no than a yes.
NethServer “is” CentOS and it uses a version of dnsmasq that is built from CentOS.
RHEL/CentOS policy dictates that software version do not usually get updated, but the original software may be patched to support features from newer versions.
However, dnsmasq was updated to 2.76 in February 2017 by red hat.
So, it may get updated again in the future (I hope it does, I need a new feature, like you).
The usual route is to open an issue with red hat in their bugzilla or make your voice heard if the issue has been already opened.
I did a search (bugzilla.redhat.com) and I didn’t find anything about dhcp-relay.

You have a couple more options:

  1. find an updated package somewhere (there are famous repositories, use google)
  2. build the package yourself

In case 2, you can try to rebuild the package from Fedora, it usually works and it will adopted by CentOS in the future.

For 1, I couldn’t find a package, but you may have better luck with google.


(Guillermo Fekete) #5

Really, really thanks for the time you spent searching this.


(Guillermo Fekete) #6

Hi!

I have it working now!

I just install dnsmasq 2.78 manually from here:

https://rpm.pbone.net/index.php3/stat/4/idpl/42477240/dir/centos_7/com/

specifically this:

ftp://ftp.pbone.net/mirror/rnd.rajven.net/centos/7.0.1406/os/x86_64/dnsmasq-2.78-1cnt7.x86_64.rpm

And I copied /etc/dnsmasq.conf to /etc/e-smith/templates-custom/etc/dnsmasq.conf and I configured the last adding:

dhcp-relay=<ip’s relay server on green net >,<ip’s dhcp server on orange net>

I expand it:

$ sudo /sbin/e-smith/expand-template /etc/dnsmasq.conf

And, after I restarted the service, all is working now.