Skip to content

Instantly share code, notes, and snippets.

@midwire
Last active January 4, 2024 20:01
Show Gist options
  • Star 53 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save midwire/a8846d93fae93a0b1045 to your computer and use it in GitHub Desktop.
Save midwire/a8846d93fae93a0b1045 to your computer and use it in GitHub Desktop.
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
done
echo "********** AFTER *****************************************"
netstat -r
echo "**********************************************************"
echo "Bringing interface down..."
sudo ifconfig en1 down
sleep 1
echo "Bringing interface back up..."
sudo ifconfig en1 up
sleep 1
echo "********** FINALLY ***************************************"
netstat -r
echo "**********************************************************"
@midwire
Copy link
Author

midwire commented Jan 4, 2024

@Cinemacloud glad it helped. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment