Hello,
I would like to use DHCP relay feature, how to enable the DHCP relay feature?
is there any suggestion? what kind of package or config needs to set up?
Thanks
Hello,
I would like to use DHCP relay feature, how to enable the DHCP relay feature?
is there any suggestion? what kind of package or config needs to set up?
Thanks
Have you looked at:
I have checked the thread(DHCP Forwarder/DHCP Relay).
I still don't fully understand how to achieve DHCP relay
The original dhcp config(/etc/config/dhcp) is
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
config dhcp 'lan'
option interface 'lan'
option start '2'
option limit '251'
option leasetime '43200'
option dhcpv6 'server'
option dhcpv4 'server'
option ra 'server'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config domain
option name 'myrouter.wifi'
option ip '192.168.1.1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
Based on https://openwrt.org/docs/guide-user/base-system/dhcp, the DHCP relay
I just need to add the following config?
or some other setting I need to setup
config relay 'id'
option interface 'lan'
option local_addr '192.168.1.1'
option server_addr '10.15.220.33'
Thanks
Interesting - last I looked, you had to tweak dnsmasq's actual generated config file manually. From the looks of things, yes, that section in /etc/config/dhcp will cause the correct configuration option to be added to the dynamically generated /var/etc/dnsmasq.conf
Also, I just noticed, in snapshot LuCI now has an interface for this. In Network->DHCP & DNS there is a Relay tab that will add the correct section to /etc/config/dhcp
Either way, the network routing has to already be up and working. On the "remote" end, you configure the relay as described in the guide. On the upstream end, you need to make sure the interface that is on the downstream subnet has dnsmasq set up to hand out IP addresses in the correct range.
Configuring through LuCI or directly in the /etc/config/dhcp
file has no effect for me.
I can only redirect requests to a DHCP server on another subnet if I add the configuration to the /etc/dnsmasq.conf
file.