CentOS/Fedora Tutorial
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
STEP 1
Install wireguard.
Fedora
$ sudo dnf install wireguard-tools
Oracle Linux 8
# dnf install oraclelinux-developer-release-el8
# dnf config-manager --disable ol8_developer
# dnf config-manager --enable ol8_developer_UEKR6
# dnf config-manager --save --setopt=ol8_developer_UEKR6.includepkgs='wireguard-tools*'
# dnf install wireguard-tools
# dnf config-manager --disable ol8_developer
# dnf config-manager --enable ol8_developer_UEKR6
# dnf config-manager --save --setopt=ol8_developer_UEKR6.includepkgs='wireguard-tools*'
# dnf install wireguard-tools
Red Hat Enterprise Linux 8
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
$ sudo yum install kmod-wireguard wireguard-tools
$ sudo yum install kmod-wireguard wireguard-tools
CentOS 8
$ sudo yum install elrepo-release epel-release
$ sudo yum install kmod-wireguard wireguard-tools
$ sudo yum install kmod-wireguard wireguard-tools
Oracle Linux 7
# yum install oraclelinux-developer-release-el7
# yum-config-manager --disable ol7_developer
# yum-config-manager --enable ol7_developer_UEKR6
# yum-config-manager --save --setopt=ol7_developer_UEKR6.includepkgs='wireguard-tools*'
# yum install wireguard-tools
# yum-config-manager --disable ol7_developer
# yum-config-manager --enable ol7_developer_UEKR6
# yum-config-manager --save --setopt=ol7_developer_UEKR6.includepkgs='wireguard-tools*'
# yum install wireguard-tools
Red Hat Enterprise Linux 7
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
$ sudo yum install kmod-wireguard wireguard-tools
$ sudo yum install kmod-wireguard wireguard-tools
CentOS 7
$ sudo yum install epel-release elrepo-release
$ sudo yum install yum-plugin-elrepo
$ sudo yum install kmod-wireguard wireguard-tools
$ sudo yum install yum-plugin-elrepo
$ sudo yum install kmod-wireguard wireguard-tools
STEP 2
Move the downloaded conf file to the wirdguard folder.
# mv /yourpath/xxx.conf /etc/wireguard/wg0.conf
(Optional) If the Wireguard folder does not exist, create the
folder.
# mkdir -p /etc/wireguard/
STEP 3
Connect to wireguard server.
# wg-quick up wg0
OUTPUT
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -6 address add <IPv6 address you obtained>/128 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] ip -6 route add ::/1 dev wg0
[#] ip -6 route add 8000::/1 dev wg0
[#] wg setconf wg0 /dev/fd/63
[#] ip -6 address add <IPv6 address you obtained>/128 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] ip -6 route add ::/1 dev wg0
[#] ip -6 route add 8000::/1 dev wg0
STEP 4
View ip address.
# ip addr
3: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen
1000
link/none
inet6 <IPv6 address you obtained>/128 scope global
valid_lft forever preferred_lft forever
link/none
inet6 <IPv6 address you obtained>/128 scope global
valid_lft forever preferred_lft forever
STEP 5
Disconnect Wireguard.
# wg-quick down wg0