-
-
Save richardstrnad/8f8170afce8adb3890a8828eb48a376a to your computer and use it in GitHub Desktop.
Reset routing table on OSX
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
#!/usr/bin/env bash | |
# Reset routing table on OSX | |
# display current routing table | |
echo "********** BEFORE ****************************************" | |
netstat -rn | |
echo "**********************************************************" | |
for i in {0..4}; do | |
sudo route -n flush # several times | |
done | |
echo "********** AFTER *****************************************" | |
netstat -rn | |
echo "**********************************************************" | |
echo "Bringing interface down..." | |
sudo ifconfig en0 down | |
sudo ifconfig en8 down | |
sleep 1 | |
echo "Bringing interface back up..." | |
sudo ifconfig en0 up | |
sudo ifconfig en8 up | |
sleep 1 | |
echo "********** FINALLY ***************************************" | |
netstat -rn | |
echo "**********************************************************" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment