DHCP Forwarding Relay IP Helper with DNSMasq / DHCPd / FWD

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 15:48    Post subject: DHCP Forwarding Relay IP Helper with DNSMasq / DHCPd / FWD Reply with quote
Hi, I know a lot of networking, but I am completely new to DD-WRT and linux!

I need some help setting up DHCP Forwarding. I would like to configure a DHCP relay on a per-VLAN basis (much like the Cisco ip helper-address command used per interface).

I can see there are 3 different DHCP packages I can use:
DHCPd
DNSMasq
DHCP Forwarder (dhcp-fwd)

I have not been able to get the DHCP forwarder mode to work, and neither is there any to manually configure it in the web GUI. I can see the configuration file for it when using SCP but I do not know how it should be configured or how to save configurations to the memory?

I may be wrong but I don't think it is possible for DHCPd to relay?

I know that DNSMasq can relay (--dhcp-relay=...) according to its own documentation (http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html) I can see how to add commands in the services tab but these are in a different format to those used in the DNSMasq documentation, is there any way to use the --dhcp-relay in DD-WRT?

(I am using an ASUS-RT-N66U, build 26138M big)


Thanks in advance

Jacob
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6856
Location: Romerike, Norway

PostPosted: Sun Sep 25, 2016 16:23    Post subject: Reply with quote
Setup->Basic Setup->Network Address Server Settings (DHCP)->DHCP Type

You can select between DHCP Server or DHCP Forwarder.

When set to Forwarder, you enter the ip address of the DHCP server that serve the sub-net.
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 16:26    Post subject: Reply with quote
Thanks for your reply.

I understand that I can choose a DHCP forwarder but I cannot configure which interfaces it runs on.

I need it to forward requests on VLAN13 to an IP address (dhcp server) on VLAN10.

I can see there is a config file (dhcp-fwd) on the router when I browse SCP but I don't know how to edit it or save it permanently.
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 17:12    Post subject: Reply with quote
I can see the dhcp-fwd config in /tmp (see photo)
But I do not know how to permanently edit it for the other VLANs.

As for the br0 which is in the dhcp-fwd config already I can get it to relay to the DHCP server (source 68 to port 67) but it will not receive the DHCP offer (source 67 to port 67) (see photo).



port-unreachable.png
 Description:
will not receive on port 67
 Filesize:  55 KB
 Viewed:  24482 Time(s)

port-unreachable.png



dhcp-fwd.png
 Description:
dhcp-fwd.conf
 Filesize:  43.88 KB
 Viewed:  24482 Time(s)

dhcp-fwd.png


Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6856
Location: Romerike, Norway

PostPosted: Sun Sep 25, 2016 18:04    Post subject: Reply with quote
That file does not survive a reboot.

Add a USB Memory Stick and load a JFFS volume to host the file.
Reload the service with a config file on the jffs volume.
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 18:09    Post subject: Reply with quote
Thanks that is useful to know.

What I would really like to know is how to use the DNSMasq
configuration commands here:
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Clearly they are very different from what is used in DD-WRT, (http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob_plain;f=dnsmasq.conf.example)

Basically I need to use the relay command
--dhcp-relay=<local address>,<server address>[,<interface]

Thanks
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 18:17    Post subject: Reply with quote
I have been trying to run the commands for dnsmasq in the console, but most don't seem to do anything except --test.


dnsmasq.png
 Description:
console
 Filesize:  11.66 KB
 Viewed:  24460 Time(s)

dnsmasq.png


Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6856
Location: Romerike, Norway

PostPosted: Sun Sep 25, 2016 18:29    Post subject: Reply with quote
Paste into the "Additional DNSMasq Options" in the Services Tab

dhcp-relay=10.13.1.1,192.168.1.8,vlan13
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 18:50    Post subject: Reply with quote
Thanks for your reply.

I have already tried that but it doesn't seem to do anything.

When I read the dd-wrt commands here it doesn't mention anything about dhcp-relay

https://github.com/mirror/dd-wrt/blob/master/src/router/dnsmasq/dnsmasq.conf.example

They are all in a completely different format to the standard DNSMasq configuration guide.

I even tried using:

interface=vlan13
dhcp-relay=10.13.1.1,192.168.1.8,vlan13
dhcp-relay=vlan13,10.13.1.1,192.168.1.8

The OpenWRT version explains how they use 2 config files - https://wiki.openwrt.org/doc/howto/dhcp.dnsmasq

I wonder if i put the --dhcp-relay command in a text file etc/dnsmasq.conf it would work. but I do not know how to restart the service
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6856
Location: Romerike, Norway

PostPosted: Sun Sep 25, 2016 19:03    Post subject: Reply with quote
killall -9 dnsmasq;
sleep 3;
dnsmasq -xxx
jacob_pro
DD-WRT Novice


Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Sep 25, 2016 19:15    Post subject: Reply with quote
I can't actually create the file in etc/dnsmasq.conf because it is read only
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12834
Location: Netherlands

PostPosted: Mon Sep 26, 2016 12:23    Post subject: Reply with quote
jacob_pro wrote:
I can't actually create the file in etc/dnsmasq.conf because it is read only


change it with the chmod command, something like
"chmod 777 myfile" I think

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum