Web lists-archives.com

Re: Ethernet is not started at boot

On Wed, Feb 07, 2018 at 01:26:05AM +0000, Brian wrote:
On Wed 07 Feb 2018 at 13:42:04 +1300, Richard Hector wrote:
The examples use CIDR notation instead, eg "address".

The netmask line is an alternative to that. You need to tell it
_somehow_ how big the subnet is.

As a changelog from May 2012 says:

 * Calculate netmask internally, so even if a user haven't supplied
   one or have used CIDR notation, hook scripts will have it properly
   specified in IF_NETMASK environment variable.

Richard is correct here. The changelog is saying that the IF_NETMASK environment variable will reflect the defaults even if they aren't specified in the configuration (this differs from the documentation which otherwise states that the environment will reflect the configuration file contents). It is *not* saying that ifupdown will somehow guess what the correct netmask is. As I said earlier, it defaults to setting the mask based on the address class, as defined in RFC 791 back in 1981. So, for example, a 10. IP will use a /8 netmask, a 172. address will use a /16 netmask, etc. If you use a 192. address you might get lucky because those IPs were in the class C space and the netmask will default to /24--which is a common configuration for consumer network devices. But IP classes are obsolete and have been since the early 90s--so it's best not to rely on them being correct when setting up your network.

Mike Stone