Site Tools


Using NETSH to Open TCP and UDP Ports

Product: Zoo 4.0
Summary: Using NETSH to open Zoo 4.0 required TCP and UDP ports.

Netsh is a Windows command-line scripting utility that allows you to, either locally or remotely, display or change the network configuration of a computer that is currently running.

Netsh also provides a scripting feature that lets you run a group of commands in batch mode against a specified computer.

Netsh can be used, instead of the Firewall applet in Control Panel, to automate the opening of required TCP/IP ports.

More information

Zoo 4.0 uses NetBIOS Mailslots for communications. NetBIOS Mailslots use the following TCP/IP ports:

  • UDP Ports 137 and 138
  • TCP Port 139

These ports need to be open on both the client Rhino workstation and the Zoo 4.0 server.

It is possible to open these ports on the Window Firewall using Netsh. The syntax is different depending on whether or not you are using Windows XP or Windows Server 2008, Windows Vista or greater.

Windows XP

Important: If you are a member of the Administrators group, run the commands from a command prompt. To start a command prompt, find the icon or Start menu entry that you use to start a command prompt session.

rem Open UDP Ports 137 and 138 and TCP Port 139
netsh firewall add portopening UDP 137 "NetBIOS UDP Port 137"
netsh firewall add portopening UDP 138 "NetBIOS UDP Port 138"
netsh firewall add portopening TCP 139 "NetBIOS TCP Port 139"

Windows Server 2008, Windows Vista or greater

Important: If you are a member of the Administrators group, and User Account Control is enabled on your computer, run the commands from a command prompt with elevated permissions. To start a command prompt with elevated permissions, find the icon or Start menu entry that you use to start a command prompt session, right-click it, and then click Run as administrator.

rem Open UDP Port 137 inbound and outbound
netsh advfirewall firewall add rule name="NetBIOS UDP Port 137" dir=in action=allow protocol=UDP localport=137
netsh advfirewall firewall add rule name="NetBIOS UDP Port 137" dir=out action=allow protocol=UDP localport=137

rem Open UDP Port 138 inbound and outbound
netsh advfirewall firewall add rule name="NetBIOS UDP Port 138" dir=in action=allow protocol=UDP localport=138
netsh advfirewall firewall add rule name="NetBIOS UDP Port 138" dir=out action=allow protocol=UDP localport=138

rem Open TCP Port 139 inbound and outbound
netsh advfirewall firewall add rule name="NetBIOS TCP Port 139" dir=in action=allow protocol=TCP localport=139
netsh advfirewall firewall add rule name="NetBIOS TCP Port 139" dir=out action=allow protocol=TCP localport=139

Reference

zoo4/usingnetsh.txt · Last modified: 2020/08/14 (external edit)