Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dnsmasq - 1 DHCP server and multiple subnets
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

Joined: 25 Feb 2005
Posts: 514
Location: Texas

PostPosted: Wed Apr 24, 2013 11:50 pm    Post subject: dnsmasq - 1 DHCP server and multiple subnets Reply with quote

I have a dnsmasq dhcp server. Working as dchp server for the subnet the host is on. However, there are other subnets connected via a Layer 3 switch. Using an ip helper address on the swtich I can point any dhcp request in other subnets to the dnsmasq server to get an ip.

Has anyone configured dnsmasq to hand out ips for multiple subnets? Id appreciate and example.
Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting.
Back to top
View user's profile Send private message
Bones McCracker

Joined: 14 Mar 2006
Posts: 1569
Location: U.S.A.

PostPosted: Tue Apr 30, 2013 6:31 am    Post subject: Reply with quote

I have done so, but only with dnsmasq installed on the router itself. The important thing is probably to clearly understand the use of the "set" and "tag" keywords. From the dnsmasq man page:
The optional set:<tag> sets an alphanumeric label which marks this network so that dhcp options may be specified on a per-network basis. When it is prefixed with 'tag:' instead, then its meaning changes from setting a tag to matching it. Only one tag may be set, but more than one tag may be matched.

Here are some of the potentially interesting configuration items that I use. Keep in mind that my dnsmasq instance is on the router itself, with a physical interface to the WAN and a physical interface to each of two subnets, which I refer to as "lan" and "dmz". You don't want to copy this, but it should at least illustrate the use of the set and tag keywords to manage multiple subnets.
# If a name in /etc/hosts has multiple addresses, return the one
# in same subnet as the interface on which the query arrived

# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.

# Set the NTP time server address to be the same machine as
# is running dnsmasq

# The following DHCP options set up dnsmasq in the same way as is specified
# for the ISC dhcpcd in
# adapted for a typical dnsmasq installation where the host running
# dnsmasq is also the host running samba.
# you may want to uncomment some or all of them if you use
# Windows clients and Samba.
dhcp-option=19,0                    # option ip-forwarding off
dhcp-option=tag:lan,44,  # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
dhcp-option=tag:dmz,44,  # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
dhcp-option=tag:lan,45,  # netbios datagram distribution server
dhcp-option=tag:dmz,45,  # netbios datagram distribution server
dhcp-option=46,8                    # netbios node type

# Send microsoft-specific option to tell windows to release the DHCP lease
# when it shuts down. Note the "i" flag, to tell dnsmasq to send the
# value as a four-byte integer - that's what microsoft wants. See
# (I want this, but only for the dmz network (for guests))

"The accumulation of all power, legislative, executive, and judiciary in the same hands...may justly be pronounced the very definition of tyranny."
--James Madison, Federalist 46
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