Score:0

Netplan wasn't applied

ug flag

I edited netplan yaml file in the /etc/netplan directory to set static ip on ens1f0 interface.

network:
  ethernets:
    eno1:
      addresses:
      - 163.239.14.35/24
      gateway4: 163.239.14.1
      nameservers:
        addresses: [163.239.1.1, 8.8.8.8]
        search: []
    ens1f0:
      addresses:
      - 172.16.10.7/12
      gateway4: 172.16.10.1
    ens1f1:
      dhcp4: true
  version: 2

However, Netplan doesn't applied even though I ran 'netplan apply' command. ifconfig tells me that ip on ens1f1 was not applied.

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 163.239.14.35  netmask 255.255.255.0  broadcast 163.239.14.255
        inet6 fe80::ec4:7aff:fed9:17ea  prefixlen 64  scopeid 0x20<link>
        ether 0c:c4:7a:d9:17:ea  txqueuelen 1000  (Ethernet)
        RX packets 214589  bytes 265226422 (265.2 MB)
        RX errors 0  dropped 2757  overruns 0  frame 0
        TX packets 49502  bytes 4862456 (4.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xfb120000-fb13ffff

ens1f0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 90:e2:ba:c4:67:c4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens1f1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 90:e2:ba:c4:67:c5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

netplan --debug apply shows me some error-like messages as below.

DEBUG:ens1f0 not found in {'eno1': {'addresses': ['163.239.14.35/24'], 'gateway4': '163.239.14.1', 'nameservers': {'addresses': ['163.239.1.1', '8.8.8.8'], 'search': []}}}
DEBUG:ens1f1 not found in {'eno1': {'addresses': ['163.239.14.35/24'], 'gateway4': '163.239.14.1', 'nameservers': {'addresses': ['163.239.1.1', '8.8.8.8'], 'search': []}}, 'ens1f0': {'addresses': ['172.16.10.7/12'], 'gateway4': '172.16.10.1'}}

What could be the problem? I spent total weekend to solve this problem.

os version: ubuntu 20.04 (server)

dummyuser avatar
uy flag
Hi JungHwanPark, welcome. Are the interfaces ens1f0 and ens1f1 connected and the link is up? please edit your question and add the output of ip a to your question. Please add the Ubuntu Version you use (including Deskop or Server), too.
us flag
The debug output suggests that you may have indentation problems in your config file. Your paste here looks correct, but you may want to double-check that `eno1`, `ens1f0`, and `ens1f1` are all at the same indentation level, with spaces not tabs.
us flag
An unrelated issue is that you are trying to use multiple `gateway4` declarations. This is not going to work. You should use `routes` with routing tables instead if you have multiple upstream Internet connections. If only one interface gives you a route to the Internet, that interface should have the gateway.
JungHwanPark avatar
ug flag
@dummyuser Can you explain the meaning of 'output of ip'? And I supplment info of os version.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.