actually that not work as network config overwrite this setting for ex netplan config
cat /etc/netplan/50-cloud-init.yaml
This file is generated from information provided by the datasource. Changes
to it will not persist across an instance reboot. To disable cloud-init’s
network configuration capabilities, write a file
/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network: {config: disabled}
network:
ethernets:
enp5s0:
addresses:
- 10.209.15.100/24
gateway4: 10.209.15.1
match:
macaddress: 00:16:3e:00:ce:00
mtu: 1500
nameservers:
addresses:
- 10.209.15.2
search:
- maas
set-name: enp5s0
version: 2