corrected hybrid swarm routing
This commit is contained in:
+3
-4
@@ -10,12 +10,11 @@
|
|||||||
mtu = 1400;
|
mtu = 1400;
|
||||||
autostart = true;
|
autostart = true;
|
||||||
postUp = ''
|
postUp = ''
|
||||||
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -j ACCEPT
|
${pkgs.procps}/bin/sysctl -w net.ipv4.conf.wg0.rp_filter=2
|
||||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -o ${lib.head config.vars.interfaces} -j MASQUERADE
|
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -o wg0 -d 10.6.0.1 -j SNAT --to-source ${config.vars.local_ip}
|
||||||
'';
|
'';
|
||||||
postDown = ''
|
postDown = ''
|
||||||
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -j ACCEPT
|
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -o wg0 -d 10.6.0.1 -j SNAT --to-source ${config.vars.local_ip}
|
||||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -o ${lib.head config.vars.interfaces}
|
|
||||||
'';
|
'';
|
||||||
privateKey = config.vars.wg_privateKey;
|
privateKey = config.vars.wg_privateKey;
|
||||||
peers = [{
|
peers = [{
|
||||||
|
|||||||
Reference in New Issue
Block a user