1

/etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens192:
      dhcp4: true
  version: 2

/run/systemd/network/10-netplan-ens192.network

[Match]
Name=ens192

[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6

[DHCP]
RouteMetric=100
UseMTU=true

ip -4 a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet 217.160.244.97/32 scope global dynamic ens192
       valid_lft 39392sec preferred_lft 39392sec

ip -4 route

default via 10.255.255.1 dev ens192 proto dhcp src 217.160.244.97 metric 100
10.255.255.1 dev ens192 proto dhcp scope link src 217.160.244.97 metric 100

service systemd-networkd status

● systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-05-11 06:30:58 UTC; 1h 5min ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 928 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 38422)
     Memory: 3.8M
     CGroup: /system.slice/systemd-networkd.service
             └─928 /lib/systemd/systemd-networkd

May 11 06:30:58 local systemd[1]: Starting Network Service...
May 11 06:30:58 local systemd-networkd[928]: Enumeration completed
May 11 06:30:58 local systemd[1]: Started Network Service.
May 11 06:30:58 local systemd-networkd[928]: ens192: IPv6 successfully enabled
May 11 06:30:58 local systemd-networkd[928]: ens192: Link UP
May 11 06:30:58 local systemd-networkd[928]: ens192: Gained carrier
May 11 06:30:58 local systemd-networkd[928]: ens192: DHCPv4 address 217.160.244.97/32 via 10.255.255.1
May 11 06:30:58 local systemd-networkd[928]: ens192: Could not set DHCPv4 route: Nexthop has invalid gateway. Network is unreachable
May 11 06:30:58 local systemd-networkd[928]: ens192: Failed

I don't know how to solve that issue! I've been trying to solve it for few days ago but still not able to figure it out.

1
  • It looks like you are using IONOS aka 1&1. They use an unusual IPv4 networking setup and you will probably need help from their support to solve this. AFAIK they don't provide any technical support for using systemd-networkd. May 11, 2020 at 22:32

2 Answers 2

2

I found adding "critical: true" in file: /etc/netplan/00-installer-config.yaml ensure that the interface did not regularly go down (seems like an issue with IONOS). The file should look like:

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens192:
      dhcp4: true
      critical: true
  version: 2

then run:

$ sudo netplan generate
$ sudo netplan apply

this should help with any network dropouts.

0

You just need to do UseRoutes=no, but activate UseGateway=yes. You may take a look at my default config.

/etc/systemd/network/default.network

[Match]
Type=!loopback

[Link]
RequiredForOnline=yes

[Network]
DHCP=yes

[DHCPv4]
UseRoutes=no
UseGateway=yes

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .