Using NETSH to Open TCP and UDP Ports

No longer supported
Zoo 4.0 was the license manager for Rhino 4, which reached end of life long ago. This article is kept for historical reference. For current LAN Zoo licensing, see the LAN Zoo guide.

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.

You can open these ports in Windows Firewall using Netsh. The syntax depends on whether you are using Windows XP or Windows Server 2008, Windows Vista, or later.

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 Later

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

How to use the “netsh advfirewall firewall” context instead of the “netsh firewall” context to control Windows Firewall behavior in Windows Server 2008 and in Windows Vista.