0

i try to set a two interfaces for my server, ubuntu server 18.04, I share internet in a lan Here is the configuration

File 01-netcfg.yaml

 network:
     version: 2
     renderer: networkd
     ethernets:
         enp4s0:
             dhcp4: true

and the 02-netcfg.yaml

 network:
     version: 2
     renderer: networkd
     ethernets:
         enp3s0:
             addresses: [192.168.1.1/24, ]
             dhcp4: false
             dhcp6: false
             nameservers:
                 addresses: [192.168.1.1, 8.8.8.8]

ifconfig returns

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 14:cc:20:02:9e:fe  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

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.12  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::e23f:49ff:fe52:22be  prefixlen 64  scopeid 0x20<link>
        ether e0:3f:49:52:22:be  txqueuelen 1000  (Ethernet)
        RX packets 3154  bytes 479397 (479.3 KB)
        RX errors 0  dropped 48  overruns 0  frame 0
        TX packets 199  bytes 28954 (28.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 308  bytes 21480 (21.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 308  bytes 21480 (21.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is netplan apply command

netplan --debug apply
** (generate:2734): DEBUG: 14:28:02.178: Processing input file /etc/netplan/01-netcfg.yaml..
** (generate:2734): DEBUG: 14:28:02.178: starting new processing pass
** (generate:2734): DEBUG: 14:28:02.179: Processing input file /etc/netplan/02-netcfg.yaml..
** (generate:2734): DEBUG: 14:28:02.179: starting new processing pass
** (generate:2734): DEBUG: 14:28:02.179: enp3s0: setting default backend to 1
** (generate:2734): DEBUG: 14:28:02.179: Configuration is valid
** (generate:2734): DEBUG: 14:28:02.179: enp4s0: setting default backend to 1
** (generate:2734): DEBUG: 14:28:02.179: Configuration is valid
** (generate:2734): DEBUG: 14:28:02.179: Generating output files..
** (generate:2734): DEBUG: 14:28:02.179: NetworkManager: definition enp4s0 is not for us (backend 1)
** (generate:2734): DEBUG: 14:28:02.179: 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:enp4s0 not found in {}
DEBUG:enp3s0 not found in {'enp4s0': {'dhcp4': True}}
DEBUG:Merged config:
network:
  bonds: {}
  bridges: {}
  ethernets:
    enp3s0:
      addresses:
      - 192.168.1.1/24
      dhcp4: false
      dhcp6: false
      nameservers:
        addresses:
        - 192.168.1.1
        - 8.8.8.8
    enp4s0:
      dhcp4: true
  vlans: {}
  wifis: {}

DEBUG:Skipping non-physical interface: lo
DEBUG:device enp4s0 operstate is up, not changing
DEBUG:Skipping non-physical interface: tap0
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp3s0
DEBUG:netplan triggering .link rules for enp4s0
DEBUG:netplan triggering .link rules for tap0

I don't know why i cannot set ip address, please anyone can help me?

  • Simply editing your yaml isn't enough to apply the settings - you DID do sudo netplan apply after editing your settings yes? – Thomas Ward Aug 13 at 14:23
  • no! i do a many times "netplan Apply" and nothing! – Bernardo Harreguy Aug 13 at 14:27
  • @user535733 doesn't matter if renderer is networkd - NM configuration only applies if Network Manager is in use, and by default in servers it's not. – Thomas Ward Aug 13 at 14:56
  • It looks like you're trying to set enp3s0 static IP to the gateway IP. – heynnema Aug 13 at 20:22
  • And addresses: [192.168.1.1/24, ] must be a typo, yes? – heynnema Aug 13 at 20:26
0

THe issue is , When the cable is unplugged, the netplan never do a config, Is waiting for a plugg in. Its all, Thanks for your reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.