diff --git a/src/wgsh/wg0-post-up.sh b/src/wgsh/wg0-post-up.sh index 1bf5460e..46a39bcc 100644 --- a/src/wgsh/wg0-post-up.sh +++ b/src/wgsh/wg0-post-up.sh @@ -18,6 +18,7 @@ $IPT -t nat -I POSTROUTING 1 -s $SUB_NET -o $IN_FACE -j MASQUERADE $IPT -I FORWARD 1 -i $WG_FACE -j ACCEPT #for internet $IPT -I FORWARD 1 -o $WG_FACE -j ACCEPT #for internet +wg-quick up wg1 systemctl start mount-mypi.service # wg set wg0 fwmark 51820 diff --git a/src/wgsh/wg1-post-up.sh b/src/wgsh/wg1-post-up.sh index d7e72f06..a26c40c2 100644 --- a/src/wgsh/wg1-post-up.sh +++ b/src/wgsh/wg1-post-up.sh @@ -3,6 +3,8 @@ set +e ip rule del not fwmark 51820 table 51820 +ip rule add from 10.250.2.0/24 table 51820 + ip route add 10.250.0.0/24 dev docker_daily table 51820 ip route add 10.250.1.0/24 dev wg0 table 51820 diff --git a/src/wgsh/wg1-pre-down.sh b/src/wgsh/wg1-pre-down.sh index 498902ad..7eb17773 100644 --- a/src/wgsh/wg1-pre-down.sh +++ b/src/wgsh/wg1-pre-down.sh @@ -1,8 +1,11 @@ #!/bin/bash set +e +ip rule del from 10.250.2.0/24 table 51820 + ip route del 10.250.0.0/24 dev docker_daily table 51820 ip route del 10.250.1.0/24 dev wg0 table 51820 + set -e \ No newline at end of file