1
Tutorials and FAQs / [Tutorial] How I do port forwarding - simple and straightforward
« on: May 29, 2018, 03:21:51 am »
Hi there!
After going through quite a few guides on the forums on how to port forward, I felt I was not getting anywhere with getting my port forwards to work.
The following is a guide on how to set up a port forward, as if you were doing it from a consumer grade router using IPv4 on v18.1 of opnsense.
Firewall settings
Firewall -> Settings -> Advanced:
Save.
Port Forwarding:
- You have a host with IP 192.168.1.200, with port 3100 open TCP.
- You want to port forward from the outside 3200 to 3100.
Step 1: Set up aliases
Too simple explanation: Aliases are friendly names to IP addresses. If you're managing a bunch of IPs to forward, it's best to give the IP address a label.
Under firewall > aliases > add a new alias
Save.
Step 2: Register the port forward
Firewall > NAT > Port forward > add
Save, and you now should be able to forward an incoming 3200 to 3100.
Feel free to respond if I should make any corrections or have comments. I'm not an expert at this, BTW.
After going through quite a few guides on the forums on how to port forward, I felt I was not getting anywhere with getting my port forwards to work.
The following is a guide on how to set up a port forward, as if you were doing it from a consumer grade router using IPv4 on v18.1 of opnsense.
Firewall settings
Firewall -> Settings -> Advanced:
Code: [Select]
- Reflection for port forwards: Enabled
- Reflection for 1:1: Disabled
- Automatic outbound NAT for Reflection: Enabled
Save.
Port Forwarding:
- You have a host with IP 192.168.1.200, with port 3100 open TCP.
- You want to port forward from the outside 3200 to 3100.
Step 1: Set up aliases
Too simple explanation: Aliases are friendly names to IP addresses. If you're managing a bunch of IPs to forward, it's best to give the IP address a label.
Under firewall > aliases > add a new alias
Code: [Select]
- name: A short friendly name for the IP address you're aliasing. I'll call it "media-server"
- type: Host(s)
- Aliases: Input 192.168.1.200
Save.
Step 2: Register the port forward
Firewall > NAT > Port forward > add
Code: [Select]
- Interface: WAN
- TCP/IP Version: IPv4
- Protocol: TCP
Under Source > Advanced:
- Source / Invert: Unchecked
- Source: Any
- Source Port Range: any to any
- Destination / Invert: Unchecked
- Destination: WAN address
- Destination Port range: (other) 3200 to (other) 3200
- Redirect target IP: Alias "media-server"
- Redirect target Port: (other) 3100
- Pool Options: Default
- NAT reflection: Enable
- Filter rule association: Rule NAT
Save, and you now should be able to forward an incoming 3200 to 3100.
Feel free to respond if I should make any corrections or have comments. I'm not an expert at this, BTW.