angristan / angristan/wireguard-install

Only do NAT if source address created by WireGuard

オープン
#586 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
11.3k
フォーク
1.7k
PR マージ指標
30日以内にマージされた PR はありません

説明

Thanks for the wonderful script!

As per some others have found on the issues list, loosing some network access after wireguard is up with new iptables rules is possible. I lost access to some other VPN beloing to libreswan on the same host.

After more googling, I found another WireGuard guide suggested that we can only do NAT if source address created by WireGuard on the iptables rules, I added -s to both the ipv4 and ipv6 lines, restarted WireGuard, and now, both WireGuard and Libreswan VPNs are working.

It might be good for the script to default to this behavior, it should save at least a subset of users who lost some previous network access prior to WireGuard install.

Source of setup guide:
https://www.cyberciti.biz/faq/how-to-set-up-wireguard-firewall-rules-in-linux

Changes to my wg0.conf:
PostUp = iptables -t nat -A POSTROUTING **-s 10.66.66.0/24** -o eth0 -j MASQUERADE
PostUp = ip6tables -t nat -A POSTROUTING **-s fd42:42:42::0/64** -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING **-s 10.66.66.0/24** -o eth0 -j MASQUERADE
PostDown = ip6tables -t nat -D POSTROUTING **-s fd42:42:42::0/64** -o eth0 -j MASQUERADE

Thanks again!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。