Last active
February 16, 2024 10:08
-
-
Save Ernillew/8b1d9f410806a56f374d5183c304ffcf to your computer and use it in GitHub Desktop.
Shutdown vpn netns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo ip netns pids vpn | xargs -rd'\n' sudo kill | |
sudo rm -rf /etc/netns/vpn | |
sudo sysctl -q net.ipv4.ip_forward=0 | |
sudo iptables -D INPUT ! -i vpn0 -s 10.10.10.0/24 -j DROP | |
sudo iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o en+ -j MASQUERADE | |
sudo ip link del vpn0 | |
sudo ip netns delete vpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment