Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Tue Apr 30, 2013 6:31 am Post subject: |
|
|
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:
Quote: | 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.
Code: | # If a name in /etc/hosts has multiple addresses, return the one
# in same subnet as the interface on which the query arrived
localise-queries
# 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.
dhcp-range=set:lan,192.168.0.15,192.168.0.30,24h
dhcp-range=set:dmz,192.168.1.15,192.168.1.30,12h
# Set the NTP time server address to be the same machine as
# is running dnsmasq
#dhcp-option=42,0.0.0.0
dhcp-option=tag:lan,42,192.168.0.1
dhcp-option=tag:dmz,42,192.168.1.1
# The following DHCP options set up dnsmasq in the same way as is specified
# for the ISC dhcpcd in
# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
# 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,192.168.0.1 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
dhcp-option=tag:dmz,44,192.168.1.1 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
dhcp-option=tag:lan,45,192.168.0.1 # netbios datagram distribution server
dhcp-option=tag:dmz,45,192.168.1.1 # 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
# http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
#dhcp-option=vendor:MSFT,2,1i
# (I want this, but only for the dmz network (for guests))
dhcp-option=tag:dmz,vendor:MSFT,2,1i |
_________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|