EdgeRouter - Port Forwarding
Overview
Readers will learn how to forward UDP and TCP ports to an internal server using the Port Forwarding feature.
Table of Contents
Frequently Asked Questions (FAQ)
What is the difference between Destination NAT and Port Forwarding?
Destination NAT and Port Forwarding serve the same purpose and can both be used to forward ports to an internal host behind NAT. |
Do I need to manually add firewall entries for each Port Forwarding rule?
No, see the steps below. |
Do I need to manually configure Hairpin NAT?
No, see the steps below. |
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.
+Add Rule
Original port: 443
Protocol: TCP
Forward-to address: 192.168.1.10
Forward-to port: 443
Description: https
3. Apply the changes.
The above configuration can also be set using the CLI:
configure
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
Related Articles
Intro to Networking - How to Establish a Connection Using SSH