Linksys AC Series Router Configuration Tips for OpenWRT: Difference between revisions

Line 906: Line 906:
A side effect of the above behavior is it overwrites MWAN3 settings that are stored in /tmp/resolv.conf.auto.  If one has custom external DNS servers enabled for multiple WAN ports they will no longer be used.  This is not a flaw with OpenWRT, just a behavior to be aware of.  If one needs to configure specific upstream DNS servers, any custom DNS servers configured with MWAN can be configured within DNSMASQ.  Again, this is just something to be aware of.
A side effect of the above behavior is it overwrites MWAN3 settings that are stored in /tmp/resolv.conf.auto.  If one has custom external DNS servers enabled for multiple WAN ports they will no longer be used.  This is not a flaw with OpenWRT, just a behavior to be aware of.  If one needs to configure specific upstream DNS servers, any custom DNS servers configured with MWAN can be configured within DNSMASQ.  Again, this is just something to be aware of.


But there is a problem if one wishes to use DHCPD and NAMED / BIND instead of DNSMASQ as the DHCPD service is not as "polite" as the DNSMASQ service (NAMED / BIND does not cause any conflict).  When the DHCPD service starts, as with DNSMASQ, the /tmp/resolv.conf file is replaced.  The settings DHCPD configures in the file are the same as DNSMASQ.  However, when the DHCPD service is stopped, as noted above, it is as "polite" as DNSMASQ because the symbolic link that directs /tmp/resolv.conf to /tmp/resolv.conf.auto is not recreated.  This leaves the /tmp/resolv.conf file configured with the setting ''nameserver 127.0.0.1''.
The following is not an issue IF a custom /etc/dhcpd.conf file exists (IE, if the default OpenWRT method for configuring DHCPD is used via the /etc/config/dhcp file):  There is a problem if one wishes to use DHCPD and NAMED / BIND instead of DNSMASQ as the DHCPD service is not as "polite" as the DNSMASQ service (NAMED / BIND does not cause any conflict).  When the DHCPD service starts, as with DNSMASQ, the /tmp/resolv.conf file is replaced.  The settings DHCPD configures in the file are the same as DNSMASQ.  However, when the DHCPD service is stopped, as noted above, it is as "polite" as DNSMASQ because the symbolic link that directs /tmp/resolv.conf to /tmp/resolv.conf.auto is not recreated.  This leaves the /tmp/resolv.conf file configured with the setting ''nameserver 127.0.0.1''. This can be an issue with BIND / NAMED if it is not configured to "answer" (listen and do recursive lookups) on 127.0.01 IP Address.  So make sure the BIND / NAMED configuration file includes 127.0.0.1 IP Address in both the allow-recursion and listen-on-port sections.
 
This can be an issue with BIND / NAMED if it is not configured to "answer" (listen and do recursive lookups) on 127.0.01 IP Address.  So make sure the BIND / NAMED configuration file includes 127.0.0.1 IP Address in both the allow-recursion and listen-on-port sections.


Oddly, when doing a Google, Bing, etc search for these three terms: "resolvfile" "openwrt" "isc_dhcpd" NOTHING exists on the internet.  Until now that is.
Oddly, when doing a Google, Bing, etc search for these three terms: "resolvfile" "openwrt" "isc_dhcpd" NOTHING exists on the internet.  Until now that is.
Line 927: Line 925:
OR
OR


* set the DNSMASQ port to Port 0 in /etc/config/dhcp dnsmasq section to disable DNS
*set the DNSMASQ port to Port 0 in /etc/config/dhcp dnsmasq section to disable DNS


==== Installation ====
====Installation====
opkg update
opkg update


Line 943: Line 941:
Check to see if the service is running: pidof named
Check to see if the service is running: pidof named


==== Configuration ====
====Configuration====
If using Slave Zones, make sure permissions are set correctly for the Directory;
If using Slave Zones, make sure permissions are set correctly for the Directory;


Line 1,104: Line 1,102:
</syntaxhighlight></div></div>
</syntaxhighlight></div></div>


==== Additional Information ====
====Additional Information====
Make sure the BIND / NAMED configuration file includes 127.0.0.1 IP Address in both the allow-recursion and listen-on-port sections.  This can cause issues with DHCPD if it is not configured correctly.  See the MWAN3 and DHCPD sections for additional information.
Make sure the BIND / NAMED configuration file includes 127.0.0.1 IP Address in both the allow-recursion and listen-on-port sections.  This can cause issues with DHCPD if it is not configured correctly.  See the MWAN3 and DHCPD sections for additional information.


Line 1,124: Line 1,122:
Watch out for the package titled "dhcpcd", as the "d" at the end might lead one to believe the "d" stands for "daemon" (AKA service).  It does not.  It is client software, hence the "c" in the name of the package.  See this for more information: https://openwrt.org/packages/pkgdata/dhcpcd
Watch out for the package titled "dhcpcd", as the "d" at the end might lead one to believe the "d" stands for "daemon" (AKA service).  It does not.  It is client software, hence the "c" in the name of the package.  See this for more information: https://openwrt.org/packages/pkgdata/dhcpcd


* opkg update
*opkg update
* opkg install isc-dhcp-server-ipv4
*opkg install isc-dhcp-server-ipv4


=====Configuration & Management=====
=====Configuration & Management=====
Line 1,142: Line 1,140:
And it opens a whole new world in the ease of configuring and managing DHCPD with Webmin, persistent settings in a dhcpd.conf style file that is similar to other Linux distributions, etc.  The following steps make this possible (plus it is fairly easy thanks to the way the /etc/init.d/dhcpd startup script is written);
And it opens a whole new world in the ease of configuring and managing DHCPD with Webmin, persistent settings in a dhcpd.conf style file that is similar to other Linux distributions, etc.  The following steps make this possible (plus it is fairly easy thanks to the way the /etc/init.d/dhcpd startup script is written);


* Create an /etc/dhcpd.conf file (the /etc/init.d/dhcpd script has provisions to search for this file)
*Create an /etc/dhcpd.conf file (the /etc/init.d/dhcpd script has provisions to search for this file)
* There is NO need to modify the /etc/init.d/dhcpd startup script file as one might think, because as noted above, the startup script has provisions for this situation;
*There is NO need to modify the /etc/init.d/dhcpd startup script file as one might think, because as noted above, the startup script has provisions for this situation;
** Orginal line: config_file=/tmp/run/dhcpd.conf
**Orginal line: config_file=/tmp/run/dhcpd.conf
** New line: config_file=/etc/dhcpd.conf
**New line: config_file=/etc/dhcpd.conf


But also keep in mind the settings changes in the /etc/init.d/dhcpd startup script only affect the DHCPD service.  The /etc/resolv.conf File still derives its settings from the /etc/config/dhcp File when the DHCPD service is restarted or the router is rebooted (same for DNSMASQ).  IE, the /etc/config/dhcp File should not be completely dismissed as useless.
But also keep in mind the settings changes in the /etc/init.d/dhcpd startup script only affect the DHCPD service.  The /etc/resolv.conf File still derives its settings from the /etc/config/dhcp File when the DHCPD service is restarted or the router is rebooted (same for DNSMASQ).  IE, the /etc/config/dhcp File should not be completely dismissed as useless.