how to prevent dnsmasq from completely failing when one of the configured interfaces is unplugged?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I'm running dnsmasq on Arch Linux on a router with 4 LAN ports for wired, wireless, DMZ and admin_interface. dnsmasq is my dhcp server for my LAN (as well as providing dns functions).
I do not always have things plugged into all 4 LAN ports. But when I reboot the device, I want it to properly come up for the ports where devices are connected, particularly the wired LAN.
My configuration is like this:
If you want dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (and the loopback) give the name of the
interface (eg eth0) here.
Repeat the line for more than one interface.
interface=eth0
interface=eth1
interface=eth2
interface=eth3
I use this config because I do not want dnsmasq running on the WAN port, which I'll call eth4 in this example.
My problem is that if I do not have the cable plugged into eth1 (for example) when the system reboots, dnsmasq does not proceed with eth0 or other valid interfaces; it fails completely as shown here:
Sep 16 14:16:10 router systemd[1]: Starting A lightweight DHCP and caching DNS server...
Sep 16 14:16:10 router dnsmasq[876]: dnsmasq: syntax check OK.
Sep 16 14:16:10 router dnsmasq[879]: dnsmasq: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: FAILED to start up
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Sep 16 14:16:10 router systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
After this, my LAN has no DHCP server and I am missing other critical functionality that dnsmasq provides until I manually go fix it and edit the config file with what is just a temporary (and undesireable) change. Is there a way to make dnsmasq start up with just the valid / connected interface(s) in my situation?
router dnsmasq
add a comment |Â
up vote
2
down vote
favorite
I'm running dnsmasq on Arch Linux on a router with 4 LAN ports for wired, wireless, DMZ and admin_interface. dnsmasq is my dhcp server for my LAN (as well as providing dns functions).
I do not always have things plugged into all 4 LAN ports. But when I reboot the device, I want it to properly come up for the ports where devices are connected, particularly the wired LAN.
My configuration is like this:
If you want dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (and the loopback) give the name of the
interface (eg eth0) here.
Repeat the line for more than one interface.
interface=eth0
interface=eth1
interface=eth2
interface=eth3
I use this config because I do not want dnsmasq running on the WAN port, which I'll call eth4 in this example.
My problem is that if I do not have the cable plugged into eth1 (for example) when the system reboots, dnsmasq does not proceed with eth0 or other valid interfaces; it fails completely as shown here:
Sep 16 14:16:10 router systemd[1]: Starting A lightweight DHCP and caching DNS server...
Sep 16 14:16:10 router dnsmasq[876]: dnsmasq: syntax check OK.
Sep 16 14:16:10 router dnsmasq[879]: dnsmasq: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: FAILED to start up
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Sep 16 14:16:10 router systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
After this, my LAN has no DHCP server and I am missing other critical functionality that dnsmasq provides until I manually go fix it and edit the config file with what is just a temporary (and undesireable) change. Is there a way to make dnsmasq start up with just the valid / connected interface(s) in my situation?
router dnsmasq
1
except-interface
?
â Arkadiusz Drabczyk
Sep 16 at 20:34
BTW, I'm not sure thatdnsmasq
fails to start because cable is not connected - possiblyeth1
interface does not exist all whendnsmasq
wants to use it.
â Arkadiusz Drabczyk
Sep 16 at 20:47
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
1
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm running dnsmasq on Arch Linux on a router with 4 LAN ports for wired, wireless, DMZ and admin_interface. dnsmasq is my dhcp server for my LAN (as well as providing dns functions).
I do not always have things plugged into all 4 LAN ports. But when I reboot the device, I want it to properly come up for the ports where devices are connected, particularly the wired LAN.
My configuration is like this:
If you want dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (and the loopback) give the name of the
interface (eg eth0) here.
Repeat the line for more than one interface.
interface=eth0
interface=eth1
interface=eth2
interface=eth3
I use this config because I do not want dnsmasq running on the WAN port, which I'll call eth4 in this example.
My problem is that if I do not have the cable plugged into eth1 (for example) when the system reboots, dnsmasq does not proceed with eth0 or other valid interfaces; it fails completely as shown here:
Sep 16 14:16:10 router systemd[1]: Starting A lightweight DHCP and caching DNS server...
Sep 16 14:16:10 router dnsmasq[876]: dnsmasq: syntax check OK.
Sep 16 14:16:10 router dnsmasq[879]: dnsmasq: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: FAILED to start up
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Sep 16 14:16:10 router systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
After this, my LAN has no DHCP server and I am missing other critical functionality that dnsmasq provides until I manually go fix it and edit the config file with what is just a temporary (and undesireable) change. Is there a way to make dnsmasq start up with just the valid / connected interface(s) in my situation?
router dnsmasq
I'm running dnsmasq on Arch Linux on a router with 4 LAN ports for wired, wireless, DMZ and admin_interface. dnsmasq is my dhcp server for my LAN (as well as providing dns functions).
I do not always have things plugged into all 4 LAN ports. But when I reboot the device, I want it to properly come up for the ports where devices are connected, particularly the wired LAN.
My configuration is like this:
If you want dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (and the loopback) give the name of the
interface (eg eth0) here.
Repeat the line for more than one interface.
interface=eth0
interface=eth1
interface=eth2
interface=eth3
I use this config because I do not want dnsmasq running on the WAN port, which I'll call eth4 in this example.
My problem is that if I do not have the cable plugged into eth1 (for example) when the system reboots, dnsmasq does not proceed with eth0 or other valid interfaces; it fails completely as shown here:
Sep 16 14:16:10 router systemd[1]: Starting A lightweight DHCP and caching DNS server...
Sep 16 14:16:10 router dnsmasq[876]: dnsmasq: syntax check OK.
Sep 16 14:16:10 router dnsmasq[879]: dnsmasq: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: unknown interface eth1
Sep 16 14:16:10 router dnsmasq[879]: FAILED to start up
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 16 14:16:10 router systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Sep 16 14:16:10 router systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
After this, my LAN has no DHCP server and I am missing other critical functionality that dnsmasq provides until I manually go fix it and edit the config file with what is just a temporary (and undesireable) change. Is there a way to make dnsmasq start up with just the valid / connected interface(s) in my situation?
router dnsmasq
router dnsmasq
edited Sep 16 at 20:33
asked Sep 16 at 20:28
MountainX
4,7112369119
4,7112369119
1
except-interface
?
â Arkadiusz Drabczyk
Sep 16 at 20:34
BTW, I'm not sure thatdnsmasq
fails to start because cable is not connected - possiblyeth1
interface does not exist all whendnsmasq
wants to use it.
â Arkadiusz Drabczyk
Sep 16 at 20:47
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
1
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57
add a comment |Â
1
except-interface
?
â Arkadiusz Drabczyk
Sep 16 at 20:34
BTW, I'm not sure thatdnsmasq
fails to start because cable is not connected - possiblyeth1
interface does not exist all whendnsmasq
wants to use it.
â Arkadiusz Drabczyk
Sep 16 at 20:47
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
1
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57
1
1
except-interface
?â Arkadiusz Drabczyk
Sep 16 at 20:34
except-interface
?â Arkadiusz Drabczyk
Sep 16 at 20:34
BTW, I'm not sure that
dnsmasq
fails to start because cable is not connected - possibly eth1
interface does not exist all when dnsmasq
wants to use it.â Arkadiusz Drabczyk
Sep 16 at 20:47
BTW, I'm not sure that
dnsmasq
fails to start because cable is not connected - possibly eth1
interface does not exist all when dnsmasq
wants to use it.â Arkadiusz Drabczyk
Sep 16 at 20:47
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
1
1
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f469436%2fhow-to-prevent-dnsmasq-from-completely-failing-when-one-of-the-configured-interf%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
except-interface
?â Arkadiusz Drabczyk
Sep 16 at 20:34
BTW, I'm not sure that
dnsmasq
fails to start because cable is not connected - possiblyeth1
interface does not exist all whendnsmasq
wants to use it.â Arkadiusz Drabczyk
Sep 16 at 20:47
@ArkadiuszDrabczyk If I plug the cable in, dnsmasq starts. Unplug it, I get the errors shown. I had tried 'except-interface' in the past and I do not remember why I gave up on it. But I tried it again just now and it appears it may work. I will test further. Thank you.
â MountainX
Sep 16 at 20:55
1
@ArkadiuszDrabczyk this cable-unplugged fragility may be related to my udev rules which rename the interfaces (or to something else unique about my system). I thought it was typical behavior, but if it is not, I will look into it further.
â MountainX
Sep 16 at 20:57