1,edit wg1,wg2,and so on .for me I use notepad.
here is a exmple:
[Interface]
PrivateKey = AKSOOkZqKNZRQaAitRn02UlYOr2wfPoLxddRHfSJ828=
Address = 10.77.1.1/24
PostUp = iptables -A FORWARD -i wg1 -j ACCEPT; iptables -A FORWARD -o wg1 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg1 -j ACCEPT; iptables -D FORWARD -o wg1 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 37148
DNS = 8.8.8.8
MTU = 1420
[Peer]
PublicKey = 3EdQfr7dh37n1q9mXDBEoYHdfelJNcr/tels6qJ9ORY=
AllowedIPs = 10.77.1.2/32
2,Save above file as wg1.conf
3,upload wg.conf to etc/wireguard
4:Set up a VPN tunnel:
wg-quick up interface_name
In this case interface_name is wg1.
now you can check your wiregurad status use command wg.
Do not forget creat client for client.
Here is the exmple
[Interface]
PrivateKey = wN2rax4ryZS0xSK8Wx6/jRzUfncip6ZjmDxqAMO9BHo=
Address = 10.77.1.2/24
DNS = 8.8.8.8
MTU = 1420
[Peer]
PublicKey = 13vB3gCM/oyT6ztYfIMeQYOEyyLZTUV0m3YdRbUP9CQ=
Endpoint = VPS public ip:listening port
AllowedIPs = 0.0.0.0/0, ::0/0
PersistentKeepalive = 25
本文由 admin 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Mar 12, 2021 at 02:52 pm
此配置在中转机使用