Traffic not flowing for hosts behind NAT - Edge Router Lite
-
This means you messed up the source and/or destination NAT rules.
I am on my phone and cannot look at this carefully.
I can also post examples of how to configure this from a working site.
-
@jaredbusch said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
This means you messed up the source and/or destination NAT rules.
I am on my phone and cannot look at this carefully.
I can also post examples of how to configure this from a working site.
I agree. I’ll look at it again after teaching tonight. I’m sure it’s staring back at me and for some reason I’m blind.
-
To check my understanding of NAT.
IIS Server
- Public: 65.254.219.165
- Private: 172.16.254.12
PostFix Server
- Public: 65.254.219.166
- Private: 172.16.254.14
Static 1:1 NAT is what's needed, and I'd have two rules for each host.
Rule 1 would be destination NAT. A packet enters the eth0 interface bound for the public IP address for the intended server. The ERL translates the destination address of this packet to the private IP address of the intended server.
Rule 2 would be a source NAT. A pack exits the eth0 interface bound for the Internet from a server with the source address as the server's private IP address. The ERL translates the source address of the pack to the public IP address of the server.
So the above example for the IIS server would look like this.
Rule 1. If a packet's destination is 65.254.219.165 is ingress to eth0, translate that packet's destination to 172.16.254.12, then send packet on to have firewall rules checked.
Rule 2. If a packet's source is 172.16.254.12 is to egress from eth0, translate that packet's source to 65.254.219.165, then send the packet on its way.
-
going to my office in a few minutes. will be able to help.
-
Delayed by kids. Putting them to bed now though
-
@jaredbusch said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
Delayed by kids. Putting them to bed now though
Worry not. I’m turning early myself. As always, I appreciate the wisdom whenever it comes.
-
@eddiejennings said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
@jaredbusch said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
Delayed by kids. Putting them to bed now though
Worry not. I’m turning early myself. As always, I appreciate the wisdom whenever it comes.
They are going to bed. Not me.
anyway. post deluge incoming.
-
Dashboard, view showing eth0 (WAN port)
-
The Port forwarding rules only work against the first IP listed on the specified port.
In this case the
.42
oneth0
FYI:.1.14
is the internal Exchange server and.0.20
is the HAProxy server for Exchange. I am only proxying SSL.
-
I have a few firewall groups setup
-
The only LAN firewall rules are to block SMTP.
-
For anything you are going to NAT in to something other than the first IP address on the default masquerade, you have to have both firewall rules and NAT destination rules.
For anything that you want to go out something other than the default masquerade, you have to have a NAT source rule.
This is the WAN_IN and is likely part of your problem.
This is the NAT (source and destination) rules that are the other part of your problem.
-
For the screenshots above, the default NAT traffic will show a "What is my IP" as
12.XXX.XXX.42
as that is the first IP listed in the config of theeth0
port.All traffic goes out through the default NAT masquerade (shown as order 4 in the Source NAT section) unless there is a Source NAT rule to override it.
As I have more than one thing happening here, we will just focus on the Nginx ones as the stuff not going through the default masquerade.
A
Source NAT
is used for outbound traffic. You are the source of the traffic.
ADestination NAT
is used for inbound traffic. You are the destination of the traffic.So to send traffic from the server with an internal IP address of
10.202.1.16
out the external IP address of12.XXX.XXX.43
instead of the default masquerade external IP of12.XXX.XXX.42
we need to make aSource NAT
rule.Make a rule and fill it out like this. Obviously, there are a lot more options here than I am going over. If you have multiple machines that you need to use this IP outbound, then create a firewall group and select the
Src Address Group
drop down instead of specifying the IP address as I did here.
Now if you check your
What is my IP
from the specified server, it should return the12.XX.XXX.43
-
The inbound is harder because you have to setup both a
Destination NAT
rule as well as allow it on the firewall'sWAN_IN
rule.First make the
Destination NAT
rule as you are already on this screen from making theSource NAT
rule.As you can see you simply reverse what you did in the
Source NAT
rule. This time the local IP goes in the Translation and the WAN IP goes in theDest Address
field. Anything coming in on this destination IP will be translated to this local IP.As you can also see, I further restricted this translation to only be TCP/UDP and only ports included in a firewall port group.
In case you are curious, here are the ports in that firewall port group.
-
Now make a firewall rule in the policy assigned to the
IN
direction of yourWAN
interface.The wizards name this rule
WAN_IN
by default.You want to make the settings match when it comes to the protocol and port settings. But the destination is now the internal IP address as the translation has already happened by the NAT rules before the firewall rules see it.
-
Now you should have traffic properly flowing to and from your alternate IP addresses.
And yes, I noticed..
-
Well done Jared.
-
When I tried this last night, my new NAT rules were all below the default masquerade one. I tried moving (click and drag) above but it wouldn't actually move.
I then added a third rule (just some fake crap), then upon having three rules I was able to move my desired rule above the default one.
I'm on firmware v1.9.7-hotfix.4
-
@jaredbusch said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
Now you should have traffic properly flowing to and from your alternate IP addresses.
Thanks for the above. I'm comparing that to my configuration now.
And yes, I noticed..
Ah, then you know the commercials.
-
@dashrender said in Traffic not flowing for hosts behind NAT - Edge Router Lite:
When I tried this last night, my new NAT rules were all below the default masquerade one. I tried moving (click and drag) above but it wouldn't actually move.
I then added a third rule (just some fake crap), then upon having three rules I was able to move my desired rule above the default one.
I'm on firmware v1.9.7-hotfix.4
Even though it didn't move, did the rule order number change?