Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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 stackoverflow.com 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

1 Answer 1

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

 
discard

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