Discussion:
[Dnsmasq-discuss] Understanding tags
Keith Lyons
2017-07-01 17:37:54 UTC
Permalink
In a recent post I was asking about sending the correct gateway to the dhcp
client, there were two options presented to me

do away with the dhcp-option=option-router statement, which I fear will
render the clients un-pingable or learn how to use tags.

Since this is a production dhcp server and it is of the upmost priority
that the clients remain online and reachable I wanted to post what i
believe to be the solution with tagging to confirm I am heading in the
correct direction.

So things to note, we are using dhcp relay on the switch (Juniper gear), I
am only using one NIC and this is a Virtual Machine hosted on VMWare 6.x


This is what I think is correct:

dhcp-range=set:net1,10.192.4.101,10.192.4.115,255.255.255.0,12h
dhcp-option=net1,3,10.192.4.1
dhcp-range=set:net2,10.192.5.101,10.192.5.150,255.255.255.0,12h
dhcp-option=net2,3,10.192.5.1
dhcp-range=set:net4,10.192.9.101,10.192.9.150,255.255.255.0,12h
dhcp-option=net4,3,10.192.9.1

The clients are setup for Option 82, see below: (there are additional
line's for the 10.192.5.X and 10.192.9.x subnets)

dhcp-circuitid=set:01_port_01,temp-2b.plant.ldn01:ge-0/0/12.0:pack1-5-302
dhcp-circuitid=set:02_port_02,temp-2b.plant.ldn01:ge-0/0/6.0:pack1-5-302
dhcp-circuitid=set:03_port_03,temp-2b.plant.ldn01:ge-0/0/2.0:pack1-5-302
dhcp-circuitid=set:04_port_04,temp-2b.plant.ldn01:ge-0/0/18.0:pack1-5-302
dhcp-circuitid=set:05_port_05,temp-2b.plant.ldn01:ge-0/0/9.0:pack1-5-302

dhcp-range=net:01_port_01,temp-2b.plant.ldn01:ge-0/0/12.0:pack1-5-302,10.192.4.11,10.192.4.11,255.255.255.0
dhcp-range=net:02_port_02,temp-2b.plant.ldn01:ge-0/0/6.0:pack1-5-302,10.192.4.21,10.192.4.21,255.255.255.0
dhcp-range=net:03_port_03,temp-2b.plant.ldn01:ge-0/0/2.0:pack1-5-302,10.192.4.31,10.192.4.31,255.255.255.0
dhcp-range=net:04_port_04,temp-2b.plant.ldn01:ge-0/0/18.0:pack1-5-302,10.192.4.41,10.192.4.41,255.255.255.0
dhcp-range=net:05_port_05,temp-2b.plant.ldn01:ge-0/0/9.0:pack1-5-302,10.192.4.51,10.192.4.51,255.255.255.0


Any advice would be greatly appreciated.

Thanks!

Keith
Keith Lyons
2017-07-10 14:19:09 UTC
Permalink
After reading through the man page several times, reading similar posts and
digging through things on the web:
https://stackoverflow.com/questions/29453522/how-to-specify-two-or-more-gateways-in-dnsmasq
i have come up with this:

dhcp-range=set:net1,10.192.4.101,10.192.4.115,255.255.255.0,12h
dhcp-option=net:net1,3,10.192.4.1
dhcp-range=set:net2,10.192.5.101,10.192.5.150,255.255.255.0,12h
dhcp-option=net:net2,3,10.192.5.1
dhcp-range=set:net3,10.192.6.101,10.192.6.150,255.255.255.0,12h
dhcp-option=net:net3,3,10.192.6.1
dhcp-range=set:net4,10.192.9.101,10.192.9.150,255.255.255.0,12h
dhcp-option=net:net4,3,10.192.9.1

If I am understanding correctly this should apply to the ranges including
the option 82 addresses, or do I need to modify the the Option 82
statements to add the GW?

Thanks,

Keith
Post by Keith Lyons
In a recent post I was asking about sending the correct gateway to the
dhcp client, there were two options presented to me
do away with the dhcp-option=option-router statement, which I fear will
render the clients un-pingable or learn how to use tags.
Since this is a production dhcp server and it is of the upmost priority
that the clients remain online and reachable I wanted to post what i
believe to be the solution with tagging to confirm I am heading in the
correct direction.
So things to note, we are using dhcp relay on the switch (Juniper gear), I
am only using one NIC and this is a Virtual Machine hosted on VMWare 6.x
dhcp-range=set:net1,10.192.4.101,10.192.4.115,255.255.255.0,12h
dhcp-option=net1,3,10.192.4.1
dhcp-range=set:net2,10.192.5.101,10.192.5.150,255.255.255.0,12h
dhcp-option=net2,3,10.192.5.1
dhcp-range=set:net4,10.192.9.101,10.192.9.150,255.255.255.0,12h
dhcp-option=net4,3,10.192.9.1
The clients are setup for Option 82, see below: (there are additional
line's for the 10.192.5.X and 10.192.9.x subnets)
dhcp-circuitid=set:01_port_01,temp-2b.plant.ldn01:ge-0/0/12.0:pack1-5-302
dhcp-circuitid=set:02_port_02,temp-2b.plant.ldn01:ge-0/0/6.0:pack1-5-302
dhcp-circuitid=set:03_port_03,temp-2b.plant.ldn01:ge-0/0/2.0:pack1-5-302
dhcp-circuitid=set:04_port_04,temp-2b.plant.ldn01:ge-0/0/18.0:pack1-5-302
dhcp-circuitid=set:05_port_05,temp-2b.plant.ldn01:ge-0/0/9.0:pack1-5-302
dhcp-range=net:01_port_01,temp-2b.plant.ldn01:ge-0/0/12.
0:pack1-5-302,10.192.4.11,10.192.4.11,255.255.255.0
dhcp-range=net:02_port_02,temp-2b.plant.ldn01:ge-0/0/6.
0:pack1-5-302,10.192.4.21,10.192.4.21,255.255.255.0
dhcp-range=net:03_port_03,temp-2b.plant.ldn01:ge-0/0/2.
0:pack1-5-302,10.192.4.31,10.192.4.31,255.255.255.0
dhcp-range=net:04_port_04,temp-2b.plant.ldn01:ge-0/0/18.
0:pack1-5-302,10.192.4.41,10.192.4.41,255.255.255.0
dhcp-range=net:05_port_05,temp-2b.plant.ldn01:ge-0/0/9.
0:pack1-5-302,10.192.4.51,10.192.4.51,255.255.255.0
Any advice would be greatly appreciated.
Thanks!
Keith
Loading...