3
ens4:
        dhcp4: false
        addresses: [192.168.8.4/24]
        nameservers:
            addresses: [1.1.1.1,8.8.8.8]
        set-name: ens4
        match:
            macaddress: xx:xx:xx:xx:xx:xx

I read a few guides and most of them had /24 as the allocation. I tried putting /32 and im not clear on why /24 works and /32 doesn't? In ubuntu 16.04 I only have to put the single address.

1 Answers1

1

Before (with /etc/network/interfaces) you had to put the netmask as a separate entry. With netplan they decided to merge the IP address and netmask value into one, so you have to specify the netmask as part of the IP address. Putting /24 would correspond to a netmask value of 255.255.255.0. Putting /32 would not make sense as it would reduce the size of the network to just the address itself.

You can read more about this here: Ubuntu 17.10 Server static IP netplan - how to set netmask