Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to start wg0 after eth0 ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Einstok_Fair
n00b
n00b


Joined: 12 Aug 2020
Posts: 40

PostPosted: Mon May 10, 2021 5:38 am    Post subject: How to start wg0 after eth0 ? Reply with quote

I have an lxc-container with a network interface. Also I want to have wireguard interface in it.
I configured everything with systemd-networkd, and sometimes it works after reboot (and some other times not).

When I do "ifconfig wg0 up && systemctl restart systemd-networkd" everything starts to work again.

My hypothesis is that sometimes wg0 goes down, but systemd-networkd doesn't reconfigure it,
it wrote
Code:

May 10 07:19:13 test3 systemd[1]: Started Network Service.
May 10 07:19:13 test3 systemd-networkd[687]: wg0: netdev exists, using existing without changing its parameters
May 10 07:19:13 test3 systemd-networkd[687]: eth0: IPv6 successfully enabled
May 10 07:19:13 test3 systemd-networkd[687]: wg0: Link UP
May 10 07:19:13 test3 systemd-networkd[687]: wg0: Gained carrier
May 10 07:19:25 test3 systemd-networkd[687]: wg0: Link DOWN
May 10 07:19:25 test3 systemd-networkd[687]: wg0: Lost carrier


What to write into /etc/systemd/network/wg0.netdev or /etc/systemd/network/wg0.network
to force wg0 be configured after eth0?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Mon May 10, 2021 5:44 pm    Post subject: Reply with quote

with systemd you can do:
systemctl enable wg-quick@wg0

Not sure how well defined the dependencies are, but it does handle bringing the VPN up and down on ubuntu, so.... Well, give it a shot.
With openrc I just added wg-quick command to post-up function. Works fine with hotplug too (I'm using a USB dongle there)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum