-1

Note: this question has changed while investigating problem to stay up to date.

Note 2: This question is invalid, the described problem is gone. Askubuntu prevents me from deleting it.

Here is my /etc/netplan/01.yaml config on my new 18.04 headless server. The file describes two of my hardware interfaces i may use:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0:
      optional: true
      dhcp4: yes
  wifis:
    wlx0013eff10948:
      access-points:
        "the-network":
          password: "the-password"
      dhcp4: yes

The problem is that Wifi connection sometimes can die. Or there is no connectivity at boot time. The same conditions are for Ethernet interface.

How can i tweak my system to adapt routing table and and etc to these changes? For now, it seems that any hardware change breaks system's "default gateway".

As a result, i can have one or both my interfaces with an assigned IP addresses without working ping in my system. And there is not problem with access point or router behind cable - my setup just cannot survive "changes" and switches..

ifconfig summary

docker0
  (br)

enp2s0 
    (no inet)
lo

tun0

   (openvpn - there is  client daemon that needs to be connected to my VPN)

wlx0013eff10948
    (inet 192.168.1.x) = shows as connected, but internet is not working

Less relevant information

wlx0013eff10948 is rtl8192cu USB dongle. I only installed linux-generic-hwe-18.04 for it to appear and work (tested with wicd-curses). As it turns out, there is no problem with WIFI - just the way system handles the lost wifi (or cable) connection.

Sometimes i can see this output appearing in machine's tty:

[ 232.2332] rtlwifi: AP off, try to reconnect now

Exactly at the state when i don't have wifi cable and wifi connection has died, but should be re-established. Which is not happening

enter image description here

  • ah... turn off VPN and see if wi-fi works then... the question keeps changing here... – heynnema Mar 14 at 20:58
  • i had to rewrite the question – Croll Mar 14 at 21:28
  • Did you get it working? What did you do? You should see Delete right underneath your question. – heynnema Mar 15 at 0:00
  • Actually, I was asking about your comment "This question is invalid, the described problem is gone. Askubuntu prevents me from deleting it.". How/why is the problem gone? Why can't you delete your question? Don't you see delete next to "share/edit/close/flag" under your question? – heynnema Mar 17 at 19:33
  • Check the update :) The problem has gone itself (reconnection started to work properly for wifi). Although it turns to be impossible to set priority for ethernet over wifi in latest ubuntu LTS (which is really bad), this question still must be deleted. Maybe i will rewrite the question and add answer later. – Croll Mar 17 at 19:46
1

Try...

An optional device is not required for booting. Normally, networkd will wait some time for device to become configured before proceeding with booting. However, if a device is marked as optional, networkd will not wait for it. This is only supported by networkd, and the default is false.

Source: https://netplan.io/reference

network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0:
      dhcp4: yes
      dhcp4-overrides:    # possibly not functional yet
        route-metric: 100 # possibly not functional yet
      optional: true
  wifis:
    wlx0013xxx:
      access-points:
        "the-network":
          password: "the-password"
      dhcp4: true
      dhcp4-overrides:    # possibly not functional yet
        route-metric: 200 # possibly not functional yet
  • 1
    Is there a way to change route metrics through netplan so ethernet is preferred whenever a wired connection is present? – gmt42 Mar 14 at 20:24
  • @gmt42 yes, see netplan.io/examples See the update to my answer. – heynnema Mar 14 at 20:28
  • @gmt42 in netplan 0.95, where is dhcp-overrides.route-metric: x section support in syntax (still yaml file version 2), but it is not released yet and will render real file invalid. This was a pain to discover – Croll Mar 14 at 20:28
  • The real problem, as it turns out, is that when i am on wifi, wifi connection to the AP dies after some (idle) time and reconnection is not happening. This feels much more troubling to my server right now. – Croll Mar 14 at 20:29
  • @Croll Note that systemd-networkd does not natively support wifi, so you need wpasupplicant installed if you let the networkd renderer handle wifi. – heynnema Mar 14 at 20:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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