Why is NAT Reflection not a good thing?
-
Hi All,
I have been fighting with DNS Resolver ever since I was talked into switching from NAT Reflection to DNS Resolver with host overrides.
With DNS Resolver I have local issues passing URL's to local serversAs an example, with DNS Resolver, www.xyz.com:xxxx passes all ports to the same IP. I need to direct to the correct IP depending on the port number. With DNS resolver everything is passed to the same IP. NAT Reflection worked flawlessly.
I have to use a domain address and not an IP in the URL because the sites are https with a certificate. Using an IP in the URL does not work.
So the big question is what is so bad about NAT Reflection that I have to give up access to local servers from local networks? What security risks am I taking using NAT Reflection? Maybe the risks do not affect me. If it is a performance issue with NAT Reflection, then I am not concerned since my activity is low.
If I should not use NAT Reflection then what are my alternatives? DNS Resolver Host Overrides doesn't work for me.
From outside the local network all works great since I use port forwards to direct the incoming ports to the correct server. I can't do that locally between interfaces using Host Overrides.
Is it possible to setup port forward rules to direct LAN traffic based on the port to the correct internal IP? Maybe setup a phantom IP that Host Overrides points to and then use port forwarding to redirect that IP to the correct internal IP based on the port number. Would that work?
-
Oh noes, no phantom hacks, please. What you really need on WAN side is SNI and reverse proxy for stuff like HTTP/HTTPS. (Can be done LAN side as well, of course, but just pointless - since, after that, you might fix the broken design that's pointing one FQDN to tons of different places depending on port. One machine, one hostname. Using the proper port, like 443 for HTTPS.
-
doktornotor, please do not question a design you know nothing about. Just shows ignorance. Let someone else help me. Every time you answer my questions it is accusatory and rude. If you can't help and be civil then don't respond.
Everything works perfectly from remote clients. HTTPS is used to invoke the certificate. All servers are setup to use HTTPS on the alternate ports which must all be addressed via the one URL. Yes I can get to any server using the IP, but with certificate errors. Nowhere is it written in stone that one must use port 443 when using a secured link.
Please, all I want to know is what are the downsides to using NAT Reflection, which works. if PFsense isn't capable of handling this, then I will just use NAT Reflection. Just looking for answers on why to not use NAT Reflection or if there any alternative solutions to using port forward locally to the LAN interface. I also simply wanted know if it is possible to port forward from the LAN side.
-
NAT itself is a hack and NAT reflections not less.
if there any alternative solutions to using port forward locally to the LAN interface.
You got the answer already.
Have you actually looked up SNI? And reverse proxies are available as pfSense packages as well. That would be a straight forward approach working from everywhere you need it to.Is it easier to complain about the perceived tone of a post than doing your homework with the infos already given? :-[
-
doktornotor, please do not question a design you know nothing about.
…
if PFsense isn't capable of handling this, then I will just use NAT Reflection.Dude, it isn't pfSense issue. It's how DNS works! SRV is the only type of records that do care about ports in DNS. Your browsers (and really vast majority of other things) do not give a damn about SRV records, not implemented. So yeah, I do question the sort of design which is broken – uhm, by design (pun intended).
Sorry to have disturbed your circles...
-
QFT:
Is it easier to complain about the perceived tone of a post than doing your homework with the infos already given? :-[
[/quote]Nicely Said!! I will have to use that myself ;) Might even make a great signature…
edit: If dok would of left off..
"Oh noes, no phantom hacks, please. "Would you have read his post differently for the correct and good information it contains? But since he makes a comment that reflects his more than likely frustration with the same sort of nonsense question and statements that just make make anyone in the field cringe.. Which has been posted about over and over and over again time and time again and again and again..
Maybe how you should take that sort of post is oh dok thinks its stupid.. So wow maybe I should rethink this.. Thanks dok!!!
-
Still no answer to the base question "Why is NAT Resolution not recommended".
SLI is not the answer since it doesn't address local port forwards. Forget about the HTTPS. Even with that aside, I still do not know how to locally direct multiple ports to different IP's in PFsense. I use port forwards for external redirection, but that does not work on the internal LAN interface.
The certificate is used by the receiving software for messages. Which is why I need to use the certificates FQDN and not an IP.I am not the one who laid blame on "bad design" which was pure ignorance. Frankly that is an insult and I take pause with that. I may not be a PFsense expert, but I have computer degrees and credentials that go back 35 years.
-
Even with that aside, I still do not know how to locally direct multiple ports to different IP's in PFsense. I use port forwards for external redirection, but that does not work on the internal LAN interface.
Yes, they do NOT work, because the communication on the same subnet does NOT go over the firewall, at all. Switch sends it directly to destination. Networking basics 101. To make it go through the firewall, the DNS would need to point to LAN interface on the firewall.
Your design is patently broken.
-
One very definite objection to NAT reflection is that it makes traffic that was never meant for the router/firewall in the first place to traverse it, every single packet of the redirected traffic. This may be a major performance issue depending on the set up. With split DNS this is never an issue because the local traffic stays local.
-
"Why is NAT Resolution not recommended"
Because it's a sub-optimal hack that sometimes breaks some network apps in certain edge cases. If it works for you then use it if it solves your problem.
Frankly that is an insult and I take pause with that.
Saying you have a broken design is not an insult. It is saying that you or someone else made a mistake, nothing more. It isn't personal and you shouldn't take it that way.
but I have computer degrees and credentials that go back 35 years.
Good for you. Same here, but I don't consider myself an expert on everything technical or computer-related. For instance, most software developers I know wouldn't know a network if a switch fell and hit them in the head. I help out here a lot, but I'm weak on IPv6 and VLANs and I know it.
The old-timers here really know their stuff, so you can take what they say and accept it even if it bruises your ego a little bit.
-
I think I may have explained my situation incorrectly. Sorry if that set anyone off and thanks for clarifying NAT Reflection.
I want the LAN subnet to be port forwarded to another interface, not on the same interface/subnet. I know that cannot work.
The local LAN is on subnet 192.168.1.0/24 - sent to a switch with 16 ports/users
The server is on interface OPT2 subnet 192.168.20.0/24 without a switch. Direct connection from OPT2 to the server. The server has 3 IP's on the NIC. 192.168.20.2/3/4. Each program on the server is bound to an internal IP on that server listening on a different port. When traffic comes from the WAN it is port forward to the correct IP. Local LAN users get directed to the one IP assigned to the DNS from the URL. I need the local users to get to the same IP's as external users.Now, as an example, I want to port forward all local LAN traffic from 192.168.1.xxx port 9999 to 192.168.20.2, port 8888 to 192.168.20.3, and port 7777 to 192.168.20.3.
Do I just setup additional rules in port forwarding specifying the LAN as the incoming? Or is there a better method?
If this is a design problem, please explain.
-
Now, as an example, I want to port forward all local LAN traffic from 192.168.1.xxx port 9999 to 192.168.20.2, port 8888 to 192.168.20.3, and port 7777 to 192.168.20.3.
… instead of having to do nothing at all, because it'd be routed just fine by default between interfaces. And you still do not understand why your design is broken? Why are you spreading the single WAN IP limitations across your entire network? How on earth does this make any sense whatsoever?
-
How is the design broken unless you mean the way I have configured PFsense which is why I am asking these questions. My setup is a simple and common one. I have a local LAN interface on 192.168.1.0/24 and one server on OPT2 with a subnet of 192.168.20.0/24.
Now, If I do a request externally to www.xyz.com:9999, traffic is forward to 192.168.20.2, www.xyz.com:8888 is forward to 192.168.20.3, and www.xyz.com:7777 is forward to 192.168.20.4. Right now, the way it is configured, from the local LAN, all www.xyz.com:xxxx traffic goes to 192.168.20.2 regardless of the port # because the port forward rules only are looking at the external NAT IP. DNS Resolver host override has www.xyz.com pointing to 192.168.20.2. If I do not use host overrides, I cannot resolve www.xyz.com locally at all.
The server I want to locally forward to is NOT on the same subnet or switch as the local LAN interface.
I just want the local LAN to go to the same IP's as the external traffic. With NAT Reflection it works fine. All I want to know is if this can be done, if not I will go back to NAT Reflection. Maybe PFsense is suppose to do this using the default routing, but it doesn't.
I will post screenshots if anyone needs them to see what I setup.
-
pfSense does routing, yeah. And DNS (except SRV records) does NOT do ports, as already explained.
192.168.20.2 - foo.example.com
192.168.20.3 - bar.example.com
192.168.20.4 - baz.example.comWill be routed just fine, traffic to every single port will be routed just fine for each of those. No need for NAT, port forwarding, NAT reflection and similar idiocy. You do not call 3 different machines the same, would seem highly obvious. It's broken even on WAN. Use CNAMEs pointing to www.example.com A record.
So yeah, go back to NAT reflection, because this is going nowhere.
-
A nice flatly laid out example, thank you. Then I can just use the correct subdomain in the host override. I can do that, just means I will have to buy more EV certs. Didn't want to go through that expense.
-
A nice flatly laid out example, thank you. Then I can just use the correct subdomain in the host override. I can do that, just means I will have to buy more EV certs. Didn't want to go through that expense.
And why would you when there is a viable solution already? If it works and serves your purpose and needs then it is not broke. As with most things there is more than one way to accomplish something. Some are better than others in one way or another but also may have other undesirable liabilities. Like cost. Sometimes the "better" way is overkill for the situation/environment etc. There are considerations that make NAT reflection the "better" solution for situations. "Hair pinning" is not a significant concern, and performance is not a significant requirement, in some cases. And NAT reflection works just fine. Labeling it a "hack" is just emotional response that doesn't really matter.
Design your infrastructure to meet your needs/requirements. That includes cost and practicality for what it needs to support, etc. Split DNS and NAT reflection are both viable designs. Use them as needed to meet your needs.
https://forum.pfsense.org/index.php?topic=122088.msg674603#msg674603
-
Thanks, I think I will go back to NAT Reflection instead of spending money on multiple EV Certificates. A shame I can't get a wildcard EV cert.
-
A nice flatly laid out example, thank you. Then I can just use the correct subdomain in the host override. I can do that, just means I will have to buy more EV certs. Didn't want to go through that expense.
Thanks, I think I will go back to NAT Reflection instead of spending money on multiple EV Certificates. A shame I can't get a wildcard EV cert.
If SAN (Subject Alterative Names) will work for you instead of a wildcard, that may be an option for your EV cert.
-
I think I will go back to NAT Reflection
Pardon my ignorance, we already learned that your servers are on a different subnet than your LAN.
It isn't NAT reflections then but simple port forwards, is it?
AFAIK a reflection only goes back to the same subnet. -
Yeah, looked into the SAN EV but the cost is even higher. That is the best solution but I previously disregarded it because of the expense. Wanted to see if there was something I could do within PFsense. That answer seems to be stay with NAT Reflection until December when the EV cert expires then get the multi-domain SAN cert
-
jahonix,
I thought so too, but no one mentioned port forwards would work with the the LAN interface when WAN port forwards already exist. Some people on this forum seem hard fast in their own design principals than coming up with answers to special situations. Sometimes we need to look outside the box.Let me re-ask this way.
Can I also port forward LAN requests to specific IP's based on the port number by specifying the LAN as the interface and destination? These ports are all uncommon port numbers not used by anything else.
Thanks for your response. This question I think got way deeper than it should have. My fault, but it got me here to ask the right question.
-
Ok I am confused on what the actual goal is here.
So you have some server that sits on a network segment behind pfsense. Lets call it 192.168.2.100..
Now you access this via some fqdn on the public internet.. lets call it www.yourdomain.com which points to your public IP that sits on pfsense wan interface.
And you have some services running on the non standard http/https ports? So Im on the public internet I hit https://www.yourdomain.com:8888 for example.. You forward this to your server 192.168.2.100
You have a ssl cert on this box that is trusted by the public since it is signed by a public CA..
So now your question is how does a box on one of your other networks, lets say clientA at 192.168.1.45 wants to go to this box and name needs to match so you cert is trusted right??
Why do port forwards come into play?? Just create a host override in your dns that points www.yourdomain.com to 192.168.2.100, and allow your devices on lan to go to 192.168.2.100 on whatever ports they might be using. So your clientA just uses the same https://www.yourdomain.com:8888 url..
I am not seeing how this is a problem?? Or has anything to do with port forwarding, nat or or nat reflection, etc.
This box at 192.168.2.100 can serve up all kinds of different site on different ports 3000, 8080, 8443, etc.. that has nothing to do with its name. Its name would always be www.yourdomain.com or whatever other names you have certs for. Your url would just reflect the port ie https://www.yourdomain.com:8443 or :9999 etc..
-
johnpoz: Really simple what's the problem. He's trying to use one hostname for multiple services on multiple machines. It's like trying to use example.com for SMTP, WWW, FTP and god knows what. Just one level up (www.example.com). That obviously does not work well neither from WAN, nor from LAN.
-
Johnpoz,
On the public internet,
if someone requests https://www.yourdomain.com:9999 it goes to 192.168.20.2
if someone requests https://www.yourdomain.com:8888 it goes to 192.168.20.3
if someone requests https://www.yourdomain.com:7777 it goes to 192.168.20.4
Port forwards handle this via the public internet. Locally on the LAN all requests goto 192.168.20.2 regardless of the port number because port forwards only redirect the public internet and DNS controls the local resolution.This is why my question was, can I setup 2 LAN port forwards as well to direct these ports 8888 and 7777 to go to the correct IP?
All I need to know is will this work? If not then I will go back to NAT Reflection until my cert expires in December. I have no choice because I have one EV cert with one FQDN. I cannot use sub-domains at this time, SSL will fail on those.
-
No you cannot, because the traffic will never hit the firewall if it resolves to LAN IPs. Already explained. Multiple times.
-
Ok then NAT Reflection it is. Thanks.
-
well for starters using ports to get to different boxes is pretty much a borked work around. Sure you can do that if you only have 1 IP. But the better solution would be to use a reverse proxy if you are limited to 1 public IP. Better solution would be to get more public IPs ;)
And with dok if your hosting these services on other boxes, they should have different names. You could still point them to your single IP and use reverse proxy.
As to not wanting to spend money to get another cert with the different name.. Again your hack is not how you would do it in any real setup. Its a hack/work around to save what amounts to a few bucks in the big picture..
If I am not mistaken you can get EV certs for free from startssl
https://www.startssl.com/NewsDetails?date=20160330While seems like there is still the 200$ validation cost, you don't have to pay a fee for your other certs is the way I read it.
Others I show ev certs are $99 a year.. If what your running is a business then that is part of doing business.. If your not running a business then you sure and the hell do not need EV certs and could just go completely free route for all your different boxes, etc.
-
It is actually one server running different apps that bind to different ports. These are not web servers apps. They are encrypted storage apps each one serves a different purpose and binds to its own unique port but must connect using SSL via a URL.
I currently use Starfield for my certs, just renewed in December. I would have to pay $349 for a multiple domain cert. The budget does not allow for the additional expense. But I can build it in for next year. This is a non-profit business that has tight funding. The beginning of the year is the worse time to get funds. Reason for the EV cert is for HIPAA regulations.
That's why I wanted to know more about NAT Reflection. I care more about security than I do performance.
-
I have a local LAN interface on 192.168.1.0/24 and one server on OPT2 with a subnet of 192.168.20.0/24.
…
The server I want to locally forward to is NOT on the same subnet or switch as the local LAN interface.No you cannot, because the traffic will never hit the firewall if it resolves to LAN IPs.
…
You can use the same principle on LAN -> OPT as you already use on WAN -> OPT.
Just copy the port forwards and change the interface from WAN to LAN, maybe add rules as well.Don't know why we run circles around this challenge over and over again.
-
Same principle as in what exactly? Create another screwed hostname override for internal LAN, pointing to OPT? Yeah, makes a lot of "sense". Really better to stick with the NAT reflection clusterfuck.
-
Sorry, I want to understand the problem which I'm currently failing.
There's one DNS entry resolving www.example.com to 192.168.20.x and it's probably already there.
The rest is just NAT.
Except for that it's not elegant, what am I missing? -
AFAIK a reflection only goes back to the same subnet.
We segregate our server subnet off from our working LAN subnet here and reach it via NAT reflection just fine. If it is not supposed to work then it must be broke.
-
AFAIK a reflection only goes back to the same subnet.
We segregate our server subnet off from our working LAN subnet here and reach it via NAT reflection just fine. If it is not supposed to work then it must be broke.
I take that tongue in cheek. But it's working as designed. It goes to the same place as the external redirect goes.
-
"It is actually one server running different apps that bind to different ports."
"They are encrypted storage apps each one serves a different purpose and binds to its own unique port but must connect using SSL via a URL."But your forwarding them to different IPs on different segments.. So how is 1 server?
if its 1 box then it would have 1 name.. If this server only has 1 IP then all you need is a host override for the name your using.. If your using ports for the different applications - then 1 host override solves your problem with your cert.
Where is the requirement from HIPAA that it needs to be EV.. TLS sure - but EV is nothing more than marketing nonsense it has nothing to do with the actual security of the connection.
https://www.atlantic.net/blog/hipaa-compliant-hosting-requirements-checklist/
"Also, be aware that an EV certificate, creating a green address bar, and/or respected brand name such as Norton or GeoTrust, can help increase trust and credibility for your system."That is not a requirement.. Just a suggestion is all.. If your a non-profit and you spent $349 for a EV that was money wasted that is for sure.. Pretty sure the requirements for HIPAA and TLS sites is that you follow nist 800-52 http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-52r1.pdf
That for sure says nothing about having to use EV cert.. Did you follow that pub?? Did you modify what ciphers are presented, there is a specific list of what can be used to follow 800-52 Is ssl v3 even off?
If the page is not actually coming up in someone's browser, and some application that hits the url for storage - then the user doesn't even see the green EV cert nonsense..
-
HIPAA is not the only reason. The lawyers and hospitals that use this server demanded an EV certificate. Not up to me or you to challenge.
There are 3 IP's in the one server bound to one NIC. Each software program is bound to an IP running on the same server. And yes the box has one FQDN. The IP's must be different with each program because they communicate internally with each other via IP addresses within the same server. All three software programs must use the same FQDN, thus run on the same server. Each software program communicates internally via an IP and externally via an HTTPS URL. Internally they use IP's. Externally they use HTTPS URL's via a browser. Yes, sub domains with a multi-domain cert would have been the way to go initially, but that is not an option right now.
The cert works fine for external internet because of port forwards, just not locally because regardless of the port number, DNS host overrides always deliver to the same IP when it should be the IP that corresponds to the correct port. So the wrong software gets the request. I cannot use IP's in the URL because the cert would be invalid.
Shortly I am trying the LAN to OPT2 port forward and see if it works.
Remember, this system always runs flawlessly from an external internet connection. And did so locally with NAT Reflection. -
Tried the new port forward LAN rules and it did not work. Went back to NAT Reflection and all works fine now.
Thanks for all your help.
-
"The lawyers and hospitals that use this server demanded an EV certificate"
Sorry but I find that hard to believe they even know the difference between an DV and EV cert.. But sure ok those seem like the most technical kind of people that should demand IT standards ;) But sure they demanded something, and now your hacking it up to get it to work. Vs using different certs for different names??
" I cannot use IP's in the URL because the cert would be invalid."
Says who?? This is a simple SAN.. There is nothing saying that your cert can not be valid and GREEN via a IP.. Now your going to have a issue trying to do that with an EV cert and using any sort of rfc1918 address..
"All three software programs must use the same FQDN, thus run on the same server"
"The IP's must be different with each program because they communicate internally with each other via IP addresses within the same server."Yeah what software is this??? I am starting to guess that is not even setup correctly or optimal at all… Your saying its a requirement of the software that it use different IPs and they have to be the same box and use the same FQDN to access?? If you need to direct some software to a port via a name it would use a SRV record so you could do that. And it uses these IPs to talk to itself?? Huh?? Is this some home grown software??? Or an actual commercial product? So the user is actually calling up these 3 different urls in their browser so they can see this demanded by them EV cert??
-
NOYB said it best in another thread. I will stick with NAT Reflection since it works perfectly and so does the software.
-
dcol, your configuration is a bit unusual, which is probably why it confused all these kids telling you it was the wrong way to do it. But your reasoning is sound. I find it amazing that you presented them with some simple limitations like budget considerations and certification requirements that are out of your control and they just couldn't get why that should be important. Amazed but not surprised. I've been doing this for decades, in technologies they've never heard of, and it never ceases to amaze me when people with such a limited scope just can't understand there are things they don't know about. People that criticize your design without having the slightest idea about your problems are neophytes and should simply be ignored.
As to your configuration, I use NAT reflection right now and am looking for a way not to. In pfSense, I've had somewhat inexplicable problems with it at times and that the only reason. Given it's simple firewall/routing, it should not add any real overhead but pfSense does not appear to do it well.
That being said, why add work to the firewall that isn't necessary. I have a much larger network than yours and use the same port forwarding internally as externally. Copying your forwarding rules from WAN -> OPT to LAN -> OPT will work. As I said, that is what I do and it works great. Very little overhead, no need for a reverse proxy (what was that about?), and you simply need to have the same config on both interfaces. It really should work.
Let me know if you still need help.
-
"budget considerations and certification requirements"
Those too statements are contradictions. There is zero reason for a EV cert in the scenario as presented.. And they are not cheap.. So if you have budget constraints an unwarranted EV cert would should never have been even considered.