0
trying to set up a fixed IP address on one of two NIC. I try using netplan. Not working at all.
Not an expert on this, I am out of my wits and ready to roll back to some other way (networkd). Maybe someone has a useful advice in any direction. Any help/ comment greatly appreciated !
(A) PROBLEM:
1) after boot, enp2s0 has no ip4 address assigned
2) this also cannot be achieved by
- :~$ sudo netplan generate
- :~$ sudo netplan apply
as a side note, tried changing interface names previously which also takes no effect.
(B) SYSTEM CONFIG:
:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
This down here remains completely unchanged, despite whatever I try with netplan (just omitting addresses for privacy):
:~$ ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether --omitted-- brd ff:ff:ff:ff:ff:ff
3: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether --omitted-- brd ff:ff:ff:ff:ff:ff
inet 192.168.2.117/24 brd 192.168.2.255 scope global dynamic enp3s0
valid_lft 1814043sec preferred_lft 1814043sec
inet6 --omitted-- scope global dynamic mngtmpaddr noprefixroute
valid_lft 604790sec preferred_lft 86390sec
inet6 --omitted-- scope link
valid_lft forever preferred_lft forever
Netplan seems to be the "official" setup:
:~$ cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
This is my netplan config, it seems to validate, as netplan invocations don't throw errors. there is only one yaml file.
:~$ 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.
# 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:
version: 2
ethernets:
enp2s0:
dhcp4: false
addresses: [192.168.1.1/24]
nameservers:
addresses: [217.0.43.65, 217.237.149.225]
search: []
enp3s0:
dhcp4: true
(C) FINDINGS/INVESTIGATIONS:
I looked at this stuff, but to no avail
https://askubuntu.com/questions/1083390/netplan-apply-does-not-change-the-ip-address
https://netplan.io/troubleshooting
netplan seems to have generated what I wanted:
:~$ cat /run/systemd/network/10-netplan-enp2s0.network
[Match]
Name=enp2s0
[Network]
LinkLocalAddressing=ipv6
Address=192.168.1.1/24
DNS=217.0.43.65
DNS=217.237.149.225
Note the generate output - anything obvious ?
:~$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:2523): DEBUG: 10:24:20.181: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:2523): DEBUG: 10:24:20.182: starting new processing pass
** (generate:2523): DEBUG: 10:24:20.182: enp3s0: setting default backend to 1
** (generate:2523): DEBUG: 10:24:20.182: Configuration is valid
** (generate:2523): DEBUG: 10:24:20.182: enp2s0: setting default backend to 1
** (generate:2523): DEBUG: 10:24:20.182: Configuration is valid
** (generate:2523): DEBUG: 10:24:20.182: Generating output files..
** (generate:2523): DEBUG: 10:24:20.182: NetworkManager: definition enp2s0 is not for us (backend 1)
** (generate:2523): DEBUG: 10:24:20.182: NetworkManager: definition enp3s0 is not for us (backend 1)
Please look at these outputs, they seem to carry the only hints:
:~$ sudo netplan --debug apply
** (generate:2528): DEBUG: 10:25:18.755: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:2528): DEBUG: 10:25:18.755: starting new processing pass
** (generate:2528): DEBUG: 10:25:18.755: enp3s0: setting default backend to 1
** (generate:2528): DEBUG: 10:25:18.755: Configuration is valid
** (generate:2528): DEBUG: 10:25:18.755: enp2s0: setting default backend to 1
** (generate:2528): DEBUG: 10:25:18.755: Configuration is valid
** (generate:2528): DEBUG: 10:25:18.755: Generating output files..
** (generate:2528): DEBUG: 10:25:18.755: NetworkManager: definition enp2s0 is not for us (backend 1)
** (generate:2528): DEBUG: 10:25:18.755: NetworkManager: definition enp3s0 is not for us (backend 1)
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:enp2s0 not found in {}
DEBUG:enp3s0 not found in {'enp2s0': {'dhcp4': False, 'addresses': ['192.168.1.1/24'], 'nameservers': {'addresses': ['217.0.43.65', '217.237.149.225'], 'search': []}}}
DEBUG:Merged config:
network:
bonds: {}
bridges: {}
ethernets:
enp2s0:
addresses:
- 192.168.1.1/24
dhcp4: false
nameservers:
addresses:
- 217.0.43.65
- 217.237.149.225
search: []
enp3s0:
dhcp4: true
vlans: {}
wifis: {}
DEBUG:Skipping non-physical interface: lo
DEBUG:device enp3s0 operstate is up, not changing
DEBUG:Skipping non-physical interface: wlp1s0
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp2s0
DEBUG:netplan triggering .link rules for enp3s0
DEBUG:netplan triggering .link rules for wlp1s0
Note it first says "netplan generated networkd configuration changed..." but then in next line "no netplan generated NM configuration exists". Sounds like some networkd config is still active ?
Also, it seems to have some problem on application level (syntax accepted) with the yaml: enp2s0 not found in {}, also in line just below that. But why ?
Many thanks in advance !