Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireguard does not work after upgrade to 3227.2.0 #808

Closed
zhanbalam opened this issue Jul 25, 2022 · 7 comments · Fixed by flatcar-archive/coreos-overlay#2061
Closed

Wireguard does not work after upgrade to 3227.2.0 #808

zhanbalam opened this issue Jul 25, 2022 · 7 comments · Fixed by flatcar-archive/coreos-overlay#2061
Labels
area/network Issues related to network. kind/bug Something isn't working

Comments

@zhanbalam
Copy link

Wireguard interface stopped getting ip address. Showing link status: link/none.

Minimal WG config to reproduce:

  1. Create file at /etc/wireguard/wg0.conf with the contents:
[Interface]
PrivateKey = GGBq7heupvx84YpvsffxbAJlLYGIwhl5YqJaBbif+UE=
ListenPort = 5555
Address = 10.0.0.1/32
  1. Run wg-quick wg0 up
  2. Run ip a

The output on flatcar v. 3227.2.0:

...
wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none
...

The output on flatcar v. 3139.2.3:

...
wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none
    inet 10.0.0.1/32 scope global wg0
       valid_lft forever preferred_lft forever
...
@tormath1
Copy link
Contributor

Hi @zhanbalam,

Sorry about that - we're currently investigating on some issues related to systemd-networkd, yours might be linked.

Could you please provide the output of:

networkctl list
networkctl status wg0
journalctl --no-pager --boot -u systemd-networkd

@tormath1 tormath1 added kind/bug Something isn't working area/network Issues related to network. labels Jul 25, 2022
@sms-system
Copy link

$ networkctl list
IDX LINK       TYPE      OPERATIONAL SETUP
  1 lo         loopback  carrier     unmanaged
  2 enp7s0     ether     routable    configured
  3 vlan       vlan      routable    configured
  4 wg-private wireguard carrier     failed
  5 wg-default wireguard carrier     failed
 12 wg0        wireguard carrier     failed

6 links listed.
$ networkctl status wg0
● 12: wg0
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /usr/lib/systemd/network/zz-default.network
                          Type: wireguard
                         State: carrier (failed)
                  Online state: offline
                           MTU: 1420 (max: 2147483552)
                         QDisc: noqueue
  IPv6 Address Generation Mode: none
          Queue Length (Tx/Rx): 1/1
             Activation Policy: up
           Required For Online: yes

Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 12:03:11 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 12:03:11 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Gained carrier
$ journalctl --no-pager --boot -u systemd-networkd
Jul 21 16:46:24 localhost systemd[1]: Starting Network Configuration...
Jul 21 16:46:24 localhost systemd-networkd[1012]: lo: Link UP
Jul 21 16:46:24 localhost systemd-networkd[1012]: lo: Gained carrier
Jul 21 16:46:24 localhost systemd-networkd[1012]: Enumeration completed
Jul 21 16:46:24 localhost systemd[1]: Started Network Configuration.
Jul 21 16:46:25 localhost systemd-networkd[1012]: vlan: netdev ready
Jul 21 16:46:25 localhost systemd-networkd[1012]: enp7s0: Link UP
Jul 21 16:46:25 localhost systemd-networkd[1012]: vlan: Link UP
Jul 21 16:46:27 localhost systemd-networkd[1012]: enp7s0: Gained carrier
Jul 21 16:46:27 localhost systemd-networkd[1012]: vlan: Gained carrier
Jul 21 16:46:29 localhost systemd-networkd[1012]: vlan: Gained IPv6LL
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-default: Link UP
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-default: Gained carrier
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-private: Link UP
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-private: Gained carrier
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-private: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-private: Failed to configure DHCPv4 client: Invalid argument
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-private: Failed
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-default: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-default: Failed to configure DHCPv4 client: Invalid argument
Jul 21 16:46:29 localhost systemd-networkd[1012]: wg-default: Failed
Jul 21 16:46:29 localhost systemd-networkd[1012]: enp7s0: Gained IPv6LL
Jul 21 16:46:31 localhost systemd-networkd[1012]: enp7s0: DHCPv4 address 65.108.127.202/26, gateway 65.108.127.193 acquired from 95.217.255.68
Jul 25 09:00:37 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 09:00:37 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 09:00:37 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 09:00:37 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 09:00:37 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 09:08:47 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 09:08:47 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Reconfiguring with /usr/lib/systemd/network/zz-default.network.
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 09:08:56 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 09:12:05 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 09:12:05 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Reconfiguring with /usr/lib/systemd/network/zz-default.network.
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 09:12:09 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 09:20:12 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 09:20:12 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 09:20:15 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 09:20:15 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 09:20:15 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 09:20:15 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 09:20:15 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 09:22:36 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 09:22:36 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 09:22:56 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 09:22:56 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 09:22:56 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 09:22:56 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 09:22:56 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 10:54:04 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 10:54:04 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 10:54:06 localhost systemd-networkd[1012]: wg0: Gained carrier
Jul 25 12:03:11 localhost systemd-networkd[1012]: wg0: Link DOWN
Jul 25 12:03:11 localhost systemd-networkd[1012]: wg0: Lost carrier
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Failed to configure DHCPv4 client: Invalid argument
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Failed
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Link UP
Jul 25 12:03:12 localhost systemd-networkd[1012]: wg0: Gained carrier

@tormath1
Copy link
Contributor

tormath1 commented Jul 25, 2022

Thanks @sms-system for providing the logs. If you have the hand on the instance, could you try to set the KeepConfiguration=yes parameter?

Or directly use this Ignition configuration:

{
  "ignition": {
    "version": "3.3.0"
  },
  "storage": {
    "files": [
      {
        "path": "/etc/systemd/networkd/zz-default.network.d/keep.conf",
        "contents": {
          "source": "data:,%5BNetwork%5D%0AKeepConfiguration%3Dyes%0A"
        }
      }
    ]
  }
}

@sms-system
Copy link

@tormath1 Nope, it doesn't work

$ cat /etc/systemd/networkd/zz-default.network.d/keep.conf
[Network]
KeepConfiguration=yes
$ sudo reboot
$ journalctl --no-pager --boot -u systemd-networkd
Jul 27 10:54:54 localhost systemd[1]: Starting Network Configuration...
Jul 27 10:54:54 localhost systemd-networkd[992]: lo: Link UP
Jul 27 10:54:54 localhost systemd-networkd[992]: lo: Gained carrier
Jul 27 10:54:54 localhost systemd-networkd[992]: Enumeration completed
Jul 27 10:54:54 localhost systemd[1]: Started Network Configuration.
Jul 27 10:54:55 localhost systemd-networkd[992]: vlan: netdev ready
Jul 27 10:54:55 localhost systemd-networkd[992]: enp7s0: Link UP
Jul 27 10:54:55 localhost systemd-networkd[992]: vlan: Link UP
Jul 27 10:54:57 localhost systemd-networkd[992]: enp7s0: Gained carrier
Jul 27 10:54:58 localhost systemd-networkd[992]: vlan: Gained carrier
Jul 27 10:54:59 localhost systemd-networkd[992]: enp7s0: Gained IPv6LL
Jul 27 10:54:59 localhost systemd-networkd[992]: vlan: Gained IPv6LL
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-default: Link UP
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-default: Gained carrier
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Failed to configure DHCPv4 client: Invalid argument
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Failed
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-default: Bumping MTU bytes from 1420 to 1500 because of stacked device. If it is not desired, then please explicitly specify MTUBytes= setting.
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-default: Failed to configure DHCPv4 client: Invalid argument
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-default: Failed
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Link UP
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Gained carrier
Jul 27 10:55:01 localhost systemd-networkd[992]: enp7s0: DHCPv4 address 65.108.127.201/26, gateway 65.108.127.193 acquired from 95.217.255.68
$ networkctl status wg-private
● 4: wg-private
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /usr/lib/systemd/network/zz-default.network
                          Type: wireguard
                         State: carrier (failed)
                  Online state: offline
                           MTU: 1420 (max: 2147483552)
                         QDisc: noqueue
  IPv6 Address Generation Mode: none
          Queue Length (Tx/Rx): 1/1
             Activation Policy: up
           Required For Online: yes

Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Bumping MTU bytes from 1420 to 1500 because of stacked device.>
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Failed to configure DHCPv4 client: Invalid argument
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Failed
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Link UP
Jul 27 10:54:59 localhost systemd-networkd[992]: wg-private: Gained carrier

@jepio
Copy link
Member

jepio commented Jul 27, 2022

Sorry, the correct path should be: /etc/systemd/network/zz-default.network.d/keep.conf

@sms-system
Copy link

Oh, yes. Wireguard works with this drop-in now

@tormath1
Copy link
Contributor

according to the documentation1:

The setting "dhcp" implies "dhcp-on-stop", and "yes" implies "dhcp" and "static".

I think we could default to KeepConfiguration=yes in place of this: https://github.com/flatcar-linux/init/blob/b99ff0626f5983af7aee47e95f34991d42f68e5b/systemd/network/zz-default.network#L3

Footnotes

  1. https://www.freedesktop.org/software/systemd/man/systemd.network.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/network Issues related to network. kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants