Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
feat: cleanup iptables rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mriedmann committed Feb 2, 2023
1 parent c2c64d0 commit c4d9be2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/root/usr/local/bin/wsl-vpnkit
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ ipconfig () {
iptables -t nat -A OUTPUT -d "$WSL2_GATEWAY_IP/32" -j DNAT --to-destination "$VPNKIT_HOST_IP"
iptables -t nat -A POSTROUTING -o "$TAP_NAME" -j MASQUERADE
echo "iptables done"

echo "iptables cleanup ..."
iptables-save | awk 'substr($0,1,1)!="-" || !x[$0]++' | iptables-restore
echo "iptables cleanup done"
}

check_ping () {
Expand Down

0 comments on commit c4d9be2

Please sign in to comment.