r/switch2hacks • u/No-Banana-403 • 23h ago
Tricks [Guide] Non-Root Android Hotspot Setup for Switch 2 (`ns2jb`) — Offline ConnTest Proxy (No PC Required)
If you want to connect your Nintendo Switch 2 to an offline Android Wi-Fi Hotspot without needing root access, a PC, or internet access, this lightweight Termux Python script answers Nintendo's connection checks (ctest / conntest) locally with 200 OK while blocking all external requests (403 Forbidden).
Step 1: Install Termux (F-Droid / GitHub Build Only)
- Download and install Termux from F-Droid or the official Termux GitHub Releases page.
- (Do not use the outdated Google Play Store build, as
pkgupdates will fail.)
Step 2: Turn ON Your Android Hotspot FIRST
- While still connected to Wi-Fi (so Termux can install
pythonon first run), turn ON your phone's Personal / Wi-Fi Hotspot now. - Why this matters: Turning your Hotspot on before running the command lets Termux immediately detect your Hotspot subnet (
192.168.93.x/192.168.43.x) instead of your home Wi-Fi IP. (If you toggle Hotspot afterward, the script also has a live watcher that auto-detects and prints the new IP.)
Step 3: Paste & Run the One-Command Installer in Termux
Open Termux, paste this entire block, and press Enter:
pkill -f 'switch-proxy' 2>/dev/null; rm -rf ~/switch-proxy; (command -v python >/dev/null 2>&1 || (pkg update -y && pkg install python -y)) && mkdir -p ~/switch-proxy && cat << 'EOF' > ~/switch-proxy/run.py
#!/data/data/com.termux/files/usr/bin/python
import socket
import threading
import time
LISTEN_HOST = "0.0.0.0"
LISTEN_PORT = 8080
CTEST_HOSTS = (
"ctest.cdn.nintendo.net",
"conntest.nintendowifi.net",
"ctest.p01.ctest.srv.nintendo.net",
"api.p01.lp1.ctest.srv.nintendo.net",
"ctest-dl.p01.lp1.ctest.srv.nintendo.net",
"ctest-ul.p01.lp1.ctest.srv.nintendo.net",
)
def can_bind(ip):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.bind((ip, 0))
return True
except OSError:
return False
finally:
s.close()
def find_all_local_ips():
found = []
priority = (93, 43, 137, 1, 0)
subnets = list(priority) + [x for x in range(256) if x not in priority]
for x in subnets:
for host in range(1, 255):
ip = f"192.168.{x}.{host}"
if can_bind(ip):
found.append(ip)
if not found:
for b in range(16, 32):
for c in range(256):
ip = f"172.{b}.{c}.1"
if can_bind(ip):
found.append(ip)
if not found:
for b in range(256):
for c in range(256):
ip = f"10.{b}.{c}.1"
if can_bind(ip):
found.append(ip)
return found
def watch_network_changes(initial_ips):
known = set(initial_ips)
while True:
time.sleep(2)
current = find_all_local_ips()
current_set = set(current)
if current_set != known:
known = current_set
print("\n-----------------------------------------------------------")
if current:
primary = next(iter(current))
print(f" [HOTSPOT / NETWORK UPDATED] New IP: {primary}")
if len(current) > 1:
print(f" Other local IPs: {' '.join(current[1:])}")
print(f" Set Switch 2 Proxy Server: {primary}")
print(f" Set Switch 2 Proxy Port: {LISTEN_PORT}")
else:
print(" [WARNING] All local IPs disconnected! Turn ON Hotspot.")
print("-----------------------------------------------------------")
def handle_client(client_sock, addr):
try:
local_ip, _ = client_sock.getsockname()
client_ip, _ = addr
request = client_sock.recv(4096).decode("utf-8", errors="ignore")
if not request:
return
first_line, _, _ = request.partition("\r\n")
method, _, rest = first_line.partition(" ")
target, _, _ = rest.partition(" ")
if not method or not target:
return
if method == "GET" and any(host in target for host in CTEST_HOSTS):
print(f"[ALLOWED - ConnTest] Switch2({client_ip}) -> Phone({local_ip}) | {target}")
response = (
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"
"X-Organization: Nintendo\r\n"
"Content-Length: 2\r\n"
"Connection: close\r\n\r\n"
"ok"
)
client_sock.sendall(response.encode("utf-8"))
else:
print(f"[BLOCKED] Switch2({client_ip}) -> Phone({local_ip}) | {method} {target}")
response = (
"HTTP/1.1 403 Forbidden\r\n"
"Content-Length: 0\r\n"
"Connection: close\r\n\r\n"
)
client_sock.sendall(response.encode("utf-8"))
except Exception:
pass
finally:
client_sock.close()
ips = find_all_local_ips()
print("===========================================================")
print(" NON-ROOT SWITCH 2 (ns2jb) PROXY ACTIVE!")
print("===========================================================")
print(" 1. Keep Mobile Data & Wi-Fi OFF on your phone.")
if ips:
primary = next(iter(ips))
print(f" 2. Detected Hotspot IP: {primary}")
if len(ips) > 1:
print(f" Other local IPs: {' '.join(ips[1:])}")
print(f" Set Switch 2 Proxy Server: {primary}")
print(f" Set Switch 2 Proxy Port: {LISTEN_PORT}")
else:
print(" 2. No active Hotspot IP detected!")
print(" Turn ON your Wi-Fi Hotspot now (auto-detecting...)")
print("===========================================================")
threading.Thread(target=watch_network_changes, args=(ips,), daemon=True).start()
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind((LISTEN_HOST, LISTEN_PORT))
server.listen(50)
print(f"Listening on port {LISTEN_PORT}...")
while True:
client, addr = server.accept()
threading.Thread(target=handle_client, args=(client, addr), daemon=True).start()
EOF
chmod +x ~/switch-proxy/run.py && ln -sf ~/switch-proxy/run.py $PREFIX/bin/switch-proxy && switch-proxyNote the Detected Hotspot IP printed on screen (e.g., 192.168.93.24).
Step 4: Turn OFF Wi-Fi & Mobile Data on Your Phone
- Turn OFF your phone's Wi-Fi and Mobile Data, leaving only your Wi-Fi Hotspot ON.
- Swipe down your Android notification shade and tap Acquire wakelock on the Termux notification so Android does not suspend Python in the background.
Step 5: Configure Switch 2 Internet Settings
- On Switch 2, go to System Settings → Internet → Internet Settings and select your Android Hotspot.
- Select Change Settings → Proxy Settings → On.
- Set Server to the Detected Hotspot IP shown in Termux (e.g.,
192.168.93.24) and Port to8080. - Select Save, then Connect to This Network.
Notes & Next-Time Launch
- Next time (100% offline): Turn ON your Hotspot, open Termux, and run
switch-proxy. - Hosting external payloads: Non-root Android apps cannot bind to ports
80/443, and Switch 2 bypasses the HTTP proxy for direct local-subnet IP URLs. Host any external web server on a separate device connected to the same hotspot (or locally on the console).
Compatibility: Tested and confirmed working on both Nintendo Switch 1 and Nintendo Switch 2.
25
Upvotes
1
u/No_Word9294 19h ago
Can you tell me for what type of ns2b entry this can be used ? smilebasic / civ7 / seedsow ?
1
u/Orbi-86 20h ago
Does this test for the browser/webkit applet supernag?
1
u/lazyluchador 13h ago
Can we use this with the CivSwitch Android exploit to prevent online connection?
0
u/bradtheoxley 20h ago
Hi dude thank you for the tutorial, apologies if I'm being thick but I've followed this, initially had wi-fi on and now have wifi and mobile data off and hotspot on and termux just says All Local IPs disconnected! Turn ON Hotspot
What am I doing wrong? You need wifi off and mobile data off don't you?