Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I want to force a netmask on my Ubuntu machine. For example, I want to get a netmask of

I tried editing /etc/network/interfaces and I forced the desired netmask, but as soon as I restarted the interfaces it changed it back to the default value.

When I used ifconfig the netmask that I gave survived the interface restart but it was reset as soon as I rebooted the machine.

Is there a way to force an "illegal" netmask on an interface?

share|improve this question

migrated from Nov 27 '11 at 20:44

This question came from our site for professional and enthusiast programmers.

it's likely that something else is changing your network parameters. NetworkManager maybe ? also post your interfaces file here. – BatchyX Nov 27 '11 at 9:44
There are no "legal" problems with that netmask - you are in control and can do what you like with it - we are a classless society now! – Linker3000 Nov 28 '11 at 9:34

ifconfig will change the interface parameters until the next time the interface is brought down and back up. Editing /etc/network/interfaces will set parameters for the interface at the next boot. So that should be all you have to do, unless some other process is managing /etc/network/interfaces, which appears to be your case. On Ubuntu this is almost certainly NetworkManager.

From the Gnome desktop you can configure the interface settings in the NetworkManager applet, and those should then apply after future reboots. I'm not sure where you'd find it in Unity or the command line, but no doubt it can be done there too.

share|improve this answer

Your Answer


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