I'm pretty new to using dnsmasq, and I would like to keep utilizing it in my lab environment. However, being new, I am unsure what commands/files to use. I've spent two days doing research and learning how my environment was configured, and I am willing to redo the whole vm at this point.
End state: I would like to configure the vm running dnsmasq to be able to serve as both the DNS and DHCP server for three vlans, each with their own subnet.
- VMware vm with ubuntu 14.04 server with three vitual NICs
- Each NIC is assigned to a vmware distributed switch port group and the distributed switch has the vlans trunked to it
- Each port group is assigned one vlan
- The three (sample) subnets are 10.1.1.0/24, 10.2.1.0/24, and 10.2.2.0/24
- The router is a Cisco Catalyst 3560
Can somebody explain, step-by-step how to setup dnsmasq to reach the desired end-state? This will not only help me but will allow others to have these instructions for future use.
While I don't want there to be too many environment specific details (to keep it applicable to a wider audience), let me know if there is anything I need to clarify.
What I have tried so far:
Declaring each nic's ip addr, netmask, network, and broadcast in the /etc/networks/interfaces file. I added in the gateway and nameserver options to the first interface, but that doesn't work.
One question/answer that looked promising suggested that i put this in the config: post-up route add 10.2.2.10 via 10.2.2.1 dev eth1, post-up route add 10.1.1.10 via 10.1.1.1 dev eth2, but that didn't work either.
I tried two types of listening in the dnsmasq config, one based on the static IP I assigned the nics and the other to the interface names, which is what I have currently:
interface=eth0 no-dhcp-interface=eth0 interface=eth1 interface=eth2 no-dhcp-interface=eth1 no-dhcp-interface=eth2
I've set option three to specify each gateway as well as the range for each interface:
I had option 6 set, but then I was told to run the command
dnsmasq -yand I kept getting binding errors. so I commented out that option. However, this is what I had:
As of right now, if I statically give a vm on the 10.1.1.0/24 subnet an addr it can ping the other vms on the other subnets. However when I try to ping 10.1.1.10 (the ip addr assigned to the dnsmasq nic for that subnet) it doesn't resolve. The dnsmasq server still works for the first subnet it was configured for (10.2.1.0/24) but I want to get it working for the other two subnets.
Also, to clarify, when I say it doesn't work, I mean that the test vm I have on one of the new subnets can not ping it's subnet's dns addr and can not get to the internet.
So, to restate, I want to get what I have to the end state described above, and while I think the community would benefit more from having a step-by-step on how to set this type of environment up for their engineers, all I need is to figure what I need to do to move my current state to the end state.
Thanks for the help in advance!