Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Per interface dnsmasq configuration.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ayvango
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2012
Posts: 118

PostPosted: Thu Dec 28, 2017 3:15 pm    Post subject: Per interface dnsmasq configuration. Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Dec 28, 2017 10:25 pm    Post subject: Re: Per interface dnsmasq configuration. Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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