If your server connects to the Internet through a cable router, DSL router, or other network router, you can configure port forwarding (or port mapping) to allow access to some services from the Internet while protecting other services and other computers on your network. Determine the port numbers for the services you want to expose on the Internet. Configure your router to forward only those ports to your server’s IP address.
Some Internet routers may require you to specify TCP or UDP for each port. For specific information about how to configure port forwarding on your router, see its documentation. If your router is an AirPort Extreme Base Station (802.11n) or an AirPort Time Capsule, you can use the Server app to configure port forwarding. For more information, see Manage AirPort port mapping and Wi-Fi login.
If your intranet has a separate firewall device, and you want to allow access to some services outside your intranet, ask the firewall administrator to open the firewall for the communications ports and protocols that your services use.
For more information about the port numbers to make available, see Well known TCP and UDP ports used by Apple software products.