Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
[SOLVED] Redirection (Destination NAT/Port Forwarding) explanation
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Redirection (Destination NAT/Port Forwarding) explanation (Read 4174 times)
srijan
Newbie
Posts: 27
Karma: 3
[SOLVED] Redirection (Destination NAT/Port Forwarding) explanation
«
on:
August 27, 2016, 11:12:07 am »
Hello Everyone,
I need a bit of an explanation on how Port Forwarding works in Opnsense. I have a simple setup. One WAN (PPPoE) and one LAN and a server connected to LAN.
LAN Address is 172.16.1.1 and IP Address of Server is 172.16.1.80. Default Gateway on Server is set to 172.16.1.1.
I have created a Port Forwarding Rule on Opnsense, to allow traffic on the WAN interface on port 2226 to forward it to the server 172.16.1.80 on port 2224. These can be seen below:
rdr on pppoe0 inet proto tcp from any to X.X.X.X port 2226 -> 172.16.1.80 port 2224
# Reflection redirect
rdr on { em0 em3 enc0 } inet proto tcp from any to X.X.X.X port 2226 -> 172.16.1.80 port 2224
no nat on em0 proto tcp from em0 to 172.16.1.80 port 2224.
When i run a tcpdump on the pppoe interface. I can see the traffic as stated below:
08:14:11.753002 IP 1.39.86.152.32254 > X.X.X.X.2226
08:14:46.574063 IP 1.39.86.152.33519 > X.X.X.X.2226
Now when I run a tcpdump on the internal interface (em0) of Opnsense, I see traffic as below:
08:14:11.753157 IP 1.39.86.152.32254 > 172.16.1.80.2224
08:14:11.753768 IP 172.16.1.80.2224 > 1.39.86.152.32254
My question here is, if i have configured a port forwarding (rdr) rule, shouldn't I see the WAN IP of the Opnsense device when I run a tcpdump on the internal port (em0) of Opnsense.
The same problem I see when I run a tcpdump on the server as well. I am getting the public client IP address instead of the WAN IP Address of the Opnsense device.
Shouldn't I see X.X.X.X instead of the client IP of 1.39.86.152. Is this now how it is supposed to work. It would be great help if someone can explain me this.
Thanks and Regards,
-=Srijan Nandi
«
Last Edit: August 28, 2016, 02:03:05 pm by franco
»
Logged
-=Srijan Nandi
srijan
Newbie
Posts: 27
Karma: 3
Re: Redirection (Destination NAT/Port Forwarding) explanation
«
Reply #1 on:
August 27, 2016, 06:57:30 pm »
Opnsense is doing exactly what it is supposed to do.This is how it should work.
My bad. My networking fundamentals needed a little brush-up.
Thanks and Regards,
-=Srijan Nandi
Logged
-=Srijan Nandi
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
[SOLVED] Redirection (Destination NAT/Port Forwarding) explanation