.bat file for opening Pi‐Network Ports 31400‐31409 - pi-node/instructions GitHub Wiki

# I noticed that many people in the Pi Network community were struggling to manually open ports 31400-31409 on Windows for their Pi Node Docker container. Manually configuring each port is time-consuming and prone to errors, especially if someone isn’t familiar with networking or firewall setups. I created this batch file to automate that process, making it faster and easier to get a Pi Node running without manually fiddling with Windows Firewall settings.

I want to reassure everyone that this batch file is not malicious—you can read the source code right here in the repository to see exactly what it does. If you still want extra peace of mind, you’re welcome to upload it to VirusTotal to scan it for any hidden threats.

    1. Copy code
    1. Open Text Editor of your choice
    1. Paste into Blank text editor
    1. Save As .bat and name it whatever you'd like
  • Make sure when you save as, that you choose .bat or it will not run * Then just run as Admin to be safe If you want to close these ports I will have code at the very bottom you can grab and repeat the same steps to undo any open ports.

THIS IS SCRIPT TO OPEN PORTS 31400-31409

@echo off echo Opening ports 31400 - 31409 in Windows Firewall for Pi Network Node...

REM Open TCP ports 31400 - 31409 netsh advfirewall firewall add rule ^ name="Open Ports 31400-31409 (TCP) for Pi Network Node" ^ dir=in action=allow protocol=TCP localport=31400-31409

REM Open UDP ports 31400 - 31409 netsh advfirewall firewall add rule ^ name="Open Ports 31400-31409 (UDP) for Pi Network Node" ^ dir=in action=allow protocol=UDP localport=31400-31409

echo Ports 31400-31409 have been opened on TCP and UDP. echo You can now run the Pi Node in a Docker container with these ports exposed. pause

This is script to close ports 31400-31409

@echo off echo Closing ports 31400 - 31409 in Windows Firewall...

REM Remove any TCP firewall rules for ports 31400 - 31409 netsh advfirewall firewall delete rule ^ protocol=TCP localport=31400-31409

REM Remove any UDP firewall rules for ports 31400 - 31409 netsh advfirewall firewall delete rule ^ protocol=UDP localport=31400-31409

echo Ports 31400-31409 have been closed on TCP and UDP. pause

Happy Pi Noding! -Haywoodj-