mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
480 B
15 lines
480 B
#!/bin/bash
|
|
set +e
|
|
|
|
IPT="/sbin/iptables"
|
|
|
|
IN_FACE="ens3" # NIC connected to the internet
|
|
WG_FACE="wg1" # WG NIC
|
|
SUB_NET="10.250.1.0/24" # WG IPv4 sub/net aka CIDR
|
|
WG_PORT="51820" # WG udp port
|
|
|
|
$IPT -t nat -I POSTROUTING 1 -s $SUB_NET -o $WG_FACE -j MASQUERADE
|
|
$IPT -I FORWARD 1 -i $WG_FACE -o wg0 -j ACCEPT #for internet
|
|
$IPT -I FORWARD 1 -i wg0 -o $WG_FACE -j ACCEPT #for internet
|
|
wg set wg0 fwmark 51820
|
|
set -e
|