Wg-quick actual commands

From AcrodusWiki

This is a reference to what commands are part of the wg-quick command. This is useful when manually setting up a wireguard vpn. Consideration should be given to the ip rule commands, which effectively determine what routing table packets that are encrypted or not use.

$ sudo wg-quick up wg0 [#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip -4 address add 10.90.90.2/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] wg set wg0 fwmark 1234 [#] ip -4 route add 0.0.0.0/0 dev wg0 table 1234 [#] ip -4 rule add not fwmark 51820 table 1234 [#] ip -4 rule add table main suppress_prefixlength 0 [#] sysctl -q net.ipv4.conf.all.src_valid_mark=1 [#] nft -f /dev/fd/63 [#] wg set wg0 private-key /etc/wireguard/wg0.key