Readers will learn how to forward UDP and TCP ports to an internal server using the Port Forwarding feature.
- Applicable to the latest EdgeOS firmware on all EdgeRouter models.
- The latest EdgeOS firmware can be downloaded from the EdgeRouter Downloads page.
- More information on the Ubiquiti Network Management System can be found on the UNMS website.
- Join the EdgeMAX discussion on the Ubiquiti Community and interact with other experts that are active on forum.
Table of Contents
Frequently Asked Questions (FAQ)
What is the difference between Destination NAT and Port Forwarding?
Do I need to manually add firewall entries for each Port Forwarding rule?
Do I need to manually configure Hairpin NAT?
Adding Port Forwarding Rules
The HTTPS traffic (TCP port 443) from external clients will be forwarded to the UNMS server.
Follow the steps below to add the Port Forwarding rules to the EdgeRouter:
1. Select the WAN and LAN interfaces that will be used for Port Forwarding. The auto-firewall feature will automatically open the required ports in the firewall.
Firewall / NAT > Port Forwarding
- Check: Show advanced options
- Check: Enable auto firewall
- Check: Enable Hairpin NAT
WAN interface: eth0
LAN interface: eth1
2. Add the port-forwarding rules for TCP ports 443.
Original port: 443
Forward-to address: 192.168.1.10
Forward-to port: 443
3. Apply the changes.
The above configuration can also be set using the CLI:
set port-forward auto-firewall enable
set port-forward hairpin-nat enable
set port-forward wan-interface eth0
set port-forward lan-interface eth1
set port-forward rule 1 description https
set port-forward rule 1 forward-to address 192.168.1.10
set port-forward rule 1 forward-to port 443
set port-forward rule 1 original-port 443
set port-forward rule 1 protocol tcp
commit ; save