<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TheGeekPirate</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TheGeekPirate"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/TheGeekPirate"/>
	<updated>2026-04-27T02:20:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=16781</id>
		<title>Configure a Wireguard interface (wg)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_a_Wireguard_interface_(wg)&amp;diff=16781"/>
		<updated>2020-01-14T02:54:00Z</updated>

		<summary type="html">&lt;p&gt;TheGeekPirate: wireguard-vanilla -&amp;gt; wireguard-lts since the change from linux-vanilla to linux-lts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wireguard is a very promising VPN technology and available since Alpine 3.10 in the community repository.&lt;br /&gt;
&lt;br /&gt;
 apk add wireguard-lts (or wireguard-virt)&lt;br /&gt;
&lt;br /&gt;
The official documents from wireguard will show examples of how to setup an interface with the use of wg-quick.&lt;br /&gt;
In this howto we are not going to use this utility but are going to use plain wg command and busybox ifupdown.&lt;br /&gt;
&lt;br /&gt;
 apk add wireguard-tools-wg&lt;br /&gt;
&lt;br /&gt;
Now that you have all the tools installed we can setup the interface.&lt;br /&gt;
The setup of your interface config is out of the scope of this document, you should consult the [https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8 manual page of wg].&lt;br /&gt;
&lt;br /&gt;
After you have finished setting up your wgX interface config you can add it to your /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
 auto wg0&lt;br /&gt;
 iface wg0 inet static&lt;br /&gt;
     address x.x.x.x&lt;br /&gt;
     netmask 255.255.255.0&lt;br /&gt;
     pre-up ip link add dev wg0 type wireguard&lt;br /&gt;
     pre-up wg setconf wg0 /etc/wireguard/wg0.conf&lt;br /&gt;
     post-up ip route add x.x.x.x/24 dev wg0&lt;br /&gt;
     post-down ip link delete dev wg0&lt;br /&gt;
&lt;br /&gt;
This config will do:&lt;br /&gt;
 &lt;br /&gt;
* bring the wireguard interface up&lt;br /&gt;
* assign a config to this interface (which you have previously created)&lt;br /&gt;
* setup the interface address and netmask&lt;br /&gt;
* add the route ones the interface is up&lt;br /&gt;
* remove the interface when it goes down&lt;br /&gt;
&lt;br /&gt;
To start the interface and stop it you can execute:&lt;br /&gt;
&lt;br /&gt;
 ifup wg0&lt;br /&gt;
 ifdown wg0&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;ifup wg0&amp;lt;/code&amp;gt; fails silently, verify that the &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; package is installed.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>TheGeekPirate</name></author>
	</entry>
</feed>