Last active
November 18, 2025 21:35
-
-
Save lessavin/1dc21cc75474bdcc4213bdbd546e52f0 to your computer and use it in GitHub Desktop.
Returns 1 if ISP put you under NAT.
This file contains hidden or 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/sh | |
| # natcheck.sh | |
| # Returns 1 if ISP put you under NAT. | |
| # Source: https://superuser.com/questions/1630106/how-do-i-find-out-if-my-isp-has-put-me-behind-a-nat-will-dynamic-dns-work-with | |
| NATCHECK_HOPS=2 # Change this value to <rounter_number>+1. | |
| if [ $NATCHECK_HOPS -lt $(traceroute $(curl -s ifconfig.me) | grep ms | wc -l) ] | |
| then | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment