/etc/network/interfaces looks like this:

auto lo eth0

iface lo inet loopback
iface eth0 inet static

I'm using ubuntu and trying to set a static IP. Any ideas on what the problem could be?


Your netmask should be not

  • which netmasks are allowed? – Lrrr May 6 '13 at 5:34
  • 1
    netmasks must be on bit-boundaries, with all 1's to the left and all 0's to the right (in binary, of course). – pjz May 6 '13 at 15:05

Look like you are on Debian based distribution.

There is a tool called netmask:

sudo apt-get install netmask

Useful to figure the netmask when you are using CIDR or even Cisco netmask. It detect wrong netmask as well:

$ netmask -s  
$ netmask -c
 netmask: invalid mask 0xe1e1e100 from ""

Quicker than reading a netmask table, it show the range of available IP in a network:

$ netmask -r  (4)
  • That's only a sort of related answer, isn't it? I mean, it leads to the right answer, but it's circuitous. – Bill Weiss Jul 15 '10 at 20:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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