Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My ISP gave me a really crappy router-modem-combination that lacks basic features. For instance you can't assign a constant ip to the mac adress of a client PC. I run a server for my home entertainment system and a storage server. Both should have a static ip within my LAN.

So my thought was to disable the DHCP-Server on the crappy modem and let my home entertainment server do the ip assignments. I was thinking dnsmasq, but I don't seem to get it to work. I thought maybe someone can help me

So the situation: is the server ip in LAN, lets say its mac is aa:aa:aa:aa:aa:aa and it is connected to a switch with device eth0. Here it's /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    gateway is the ip of the cable modem (set statically). It is connected to the internet and the same switch as the server. mac: bb:bb:bb:bb:bb:bb

192,168.0.3 is supposed to be the future ip of the network storage system, lets say its mac adress is cc:cc:cc:cc:cc:cc. It is also connected to the same switch as the other devices

What I've done so far:

I've installed dnsmasq on the server, stopped the service and edited /etc/dnsmasq.conf to look like this:


I've edited /etc/resolv.conf to contain the localhost (server) and the nameservers of the ISP:

nameserver 123.321.123.321
nameserver 321.123.321.123

The Problem:

The DHCP works just fine, but for some reason dnsmasq gives the wrong gateway. It gives the server's ip instead of the gateways.

share|improve this question
up vote 1 down vote accepted

Okay, I just found out about the dhcp-option in /etc/dnsmasq.conf:


That solves the problem. Sorry to bother you. Hope it will help someone else, at least!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.