View previous topic :: View next topic |
Author |
Message |
ayvango Tux's lil' helper

Joined: 08 Feb 2012 Posts: 118
|
Posted: Thu Dec 28, 2017 3:15 pm Post subject: Per interface dnsmasq configuration. |
|
|
I have dynamic interfaces that could changes up and down state arbitrarily. I tried to configure them all in the single /etc/dnsmasq.conf file. But it works only if all of interfaces are up simultaneously. If some is down, dnsmasq could not bind it and fails to start.
I give thought to the problem and think that most rational solution is to run one dnsmasq server per interfaces. Is it possible to separate dnsmasq.conf files per interface like /etc/openvpn solves similar task? |
|
Back to top |
|
 |
khayyam Watchman


Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Dec 28, 2017 10:25 pm Post subject: Re: Per interface dnsmasq configuration. |
|
|
ayvango wrote: | I give thought to the problem and think that most rational solution is to run one dnsmasq server per interfaces. Is it possible to separate dnsmasq.conf files per interface like /etc/openvpn solves similar task? |
ayvango ... openrc supports per interface (and/or runlevel) init/config, I've not done this with dnsmasq but the following should do as you request:
Code: | # ln -s /etc/init.d/dnsmask /etc/init.d/dnsmask.eth0
# cp /etc/conf.d/dnsmask /etc/conf.d/dnsmask.eth0
# egrep -v '^(#|$)' /etc/conf.d/dnsmask.eth0
DNSMASQ_OPTS="--user=dnsmasq --group=dnsmasq --config-file=/etc/dnsmasq/dnsmasq-eth0.conf"
# cp /etc/dnsmasq/dnsmasq.conf /etc/dnsmasq/dnsmasq-eth0.conf
... [edit /etc/dnsmasq/dnsmasq-eth0.conf]
# rc-update del dnsmasq <runlevel>
# rc-update add dnsmasq.eth0 <runlevel> |
See here for a more detailed example.
HTH & best ... khay |
|
Back to top |
|
 |
|