<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Slow NAT]]></title><description><![CDATA[<p dir="auto">hi,</p>
<p dir="auto">I have pfsense running on proxmox as a virtual machine. Basically is working everything normally. Except that i noticed that an API which is NAT-ed, has a high latency when replying.<br />
The API is running on the LAN side of the pfSense, and initially we were blaming the API for the slowness.<br />
Than, i tested locally from another machine on the LAN and is super fast. 40ms vs 3500ms</p>
<p dir="auto">TCP offloading is disabled.<br />
Any idea what could be the issue?</p>
<p dir="auto">thanks</p>
]]></description><link>https://forum.netgate.com/topic/181010/slow-nat</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 20:59:30 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/181010.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Jun 2023 14:50:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Slow NAT on Thu, 29 Jun 2023 09:40:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/johnpoz">@<bdi>johnpoz</bdi></a> thanks for the tip and i did the same test.<br />
Window on top is WAN and on the bottom is LAN. I just captured 10 packets from each interface and seems it is pretty fast so the culprit is not the NAT.</p>
<p dir="auto"><img src="/assets/uploads/files/1688031638913-a243489b-bc55-49e5-87b2-747bd73a304f-image.png" alt="a243489b-bc55-49e5-87b2-747bd73a304f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Found though two solutions but still not why it is happening.</p>
<ul>
<li>
<p dir="auto">Remove Accept-Encoding header from the http request - result is very fast.</p>
</li>
<li>
<p dir="auto">Using a reverse proxy with https is still fast with and without the Accept-Encoding header</p>
</li>
</ul>
]]></description><link>https://forum.netgate.com/post/1112784</link><guid isPermaLink="true">https://forum.netgate.com/post/1112784</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Thu, 29 Jun 2023 09:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Mon, 26 Jun 2023 14:14:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/albgen">@<bdi>albgen</bdi></a> so you think pfsense natting the traffic is adding like 3.5 seconds to your response time?</p>
<p dir="auto">Well easy enough to check if pfsense is doing that.. Do a sniff on your wan and on your lan at same time and send some traffic what is the delay caused by pfsense sending it on..</p>
<p dir="auto">So example</p>
<p dir="auto"><img src="/assets/uploads/files/1687788223533-mathnat.jpg" alt="mathnat.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Here is me coming from can you see me to port 23040 which is forwarded to my plex on 32400 on 192.168.9.10</p>
<p dir="auto">So sniffing on my wan and my lan at same time with tcpdump I see when it hits my wan and when it gets sent on, see the Syn and the Syn,Acks</p>
<p dir="auto">Lets do the math..</p>
<p dir="auto">So syn hits my wan at 48.108772, and that is sent on to 192.168.9.100 at 48.108886 so a delay of .000114 seconds, or 0.114 ms</p>
<p dir="auto">Now the syn,ack hits my lan at 48.109230, and sent out my wan at 48.109270 for a delay caused by pfsense of .000040 seconds..</p>
<p dir="auto">So lets see the delay your pfsense creating - 3.5 seconds seems highly unlikely to me..</p>
]]></description><link>https://forum.netgate.com/post/1112354</link><guid isPermaLink="true">https://forum.netgate.com/post/1112354</guid><dc:creator><![CDATA[johnpoz]]></dc:creator><pubDate>Mon, 26 Jun 2023 14:14:06 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Mon, 26 Jun 2023 13:27:38 GMT]]></title><description><![CDATA[<p dir="auto">I just added a NAT on WAN2 which has a Public IP setup and yet the same slowness.</p>
]]></description><link>https://forum.netgate.com/post/1112343</link><guid isPermaLink="true">https://forum.netgate.com/post/1112343</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Mon, 26 Jun 2023 13:27:38 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Sat, 24 Jun 2023 08:11:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/viragomann">@<bdi>viragomann</bdi></a></p>
<p dir="auto">those logs are already enabled.<br />
Of course it is virtualised. Check the first post</p>
]]></description><link>https://forum.netgate.com/post/1112067</link><guid isPermaLink="true">https://forum.netgate.com/post/1112067</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Sat, 24 Jun 2023 08:11:43 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 20:16:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/albgen">@<bdi>albgen</bdi></a> said in <a href="/post/1112007">Slow NAT</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/viragomann">@<bdi>viragomann</bdi></a> I think it is not even possible to enable the "Log packets  on the default block rules in the ruleset" .</p>
</blockquote>
<p dir="auto"><em>Status &gt; System Logs &gt; Settings &gt; Log packets matched from the default block rules in the ruleset</em></p>
<blockquote>
<p dir="auto">There is no router in front. It is just a masquerade of the nic: The topology is<br />
nic with public ip-&gt;dnat(iptables -t nat -A PREROUTING --dst 65.XXX.XX.XX -j DNAT --to-destination 10.21.21.120)-&gt;wan pfsense.</p>
</blockquote>
<p dir="auto">Yeah, this is exactly what a NAT router does.</p>
<p dir="auto">What is the sense of forwarding the whole traffic instead of having the public IP directly on pfSense?</p>
<p dir="auto">Presumably your pfSense is virtualized. Which hypervisor? Is it installed accordingly?<br />
Do you have other connections through pfSense, which have a low latency?</p>
]]></description><link>https://forum.netgate.com/post/1112009</link><guid isPermaLink="true">https://forum.netgate.com/post/1112009</guid><dc:creator><![CDATA[viragomann]]></dc:creator><pubDate>Fri, 23 Jun 2023 20:16:50 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 20:01:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/viragomann">@<bdi>viragomann</bdi></a> I think it is not even possible to enable the "Log packets  on the default block rules in the ruleset" .<br />
There is no router in front. It is just a masquerade of the nic: The topology is<br />
nic with public ip-&gt;dnat(iptables -t nat -A PREROUTING --dst 65.XXX.XX.XX -j DNAT --to-destination 10.21.21.120)-&gt;wan pfsense.</p>
]]></description><link>https://forum.netgate.com/post/1112007</link><guid isPermaLink="true">https://forum.netgate.com/post/1112007</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Fri, 23 Jun 2023 20:01:51 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 17:18:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/albgen">@<bdi>albgen</bdi></a><br />
Ensure that you've "Log packets matched from the default block rules in the ruleset" enabled and check if there are blocks in the log from machine 1.</p>
<p dir="auto">Also there is obviously a router in front of your pfSense. Connect a computer directly to the WAN interface of pfSense and test the access via NAT from it.</p>
]]></description><link>https://forum.netgate.com/post/1111994</link><guid isPermaLink="true">https://forum.netgate.com/post/1111994</guid><dc:creator><![CDATA[viragomann]]></dc:creator><pubDate>Fri, 23 Jun 2023 17:18:57 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 16:32:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/steveits">@<bdi>SteveITS</bdi></a> Correct, Machine 1 gateway is the pfSense LAN IP.<br />
Machine 2 also has gateway the pfSense LAN IP and is on the same interface, so LAN1</p>
]]></description><link>https://forum.netgate.com/post/1111991</link><guid isPermaLink="true">https://forum.netgate.com/post/1111991</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Fri, 23 Jun 2023 16:32:35 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 16:27:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/albgen">@<bdi>albgen</bdi></a><br />
Machine1's gateway is the pfSense LAN IP?</p>
<p dir="auto">Is Machine2 connecting to Machine1 through pfSense's WAN IP via NAT reflection? Or direct to Machine1 across the network?</p>
<p dir="auto">If it's using reflection and is fast, yet connecting from WAN is slow, then I am not sure what would be going on, I don't recall running into that.</p>
]]></description><link>https://forum.netgate.com/post/1111989</link><guid isPermaLink="true">https://forum.netgate.com/post/1111989</guid><dc:creator><![CDATA[SteveITS]]></dc:creator><pubDate>Fri, 23 Jun 2023 16:27:13 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 16:15:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/steveits">@<bdi>SteveITS</bdi></a> said in <a href="/post/1111984">Slow NAT</a>:</p>
<blockquote>
<p dir="auto">https://docs.netgate.com/pfsense/en/latest/troubleshooting/asymmetric-routing.html</p>
</blockquote>
<p dir="auto">Regarding the configs, find it here <a href="/assets/uploads/files/1687536401876-config-pfsenseedgerouter.localdomain-20230623180532.xml">config-pfSenseEdgeRouter.localdomain-20230623180532.xml</a></p>
<p dir="auto">LAN side has several machines, Windows and Linux servers.<br />
The API is running on machine 1. There is a NAT(port forward) from wan to lan for the port of the API(7068).</p>
<p dir="auto">Tests are done using postman.<br />
From the same machine 1, if i issue a request for the api, it is super fast(40ms). From machine 2 which is on the same network as machine 1, i issue the same request, result is super fast.</p>
<p dir="auto">From any laptop/computer which requests comes from the wan, more than 3 seconds of reply.</p>
<p dir="auto">I see on the states of the firewall 2 connections from the machine outside wan. They are not closed and they are opened<br />
<img src="/assets/uploads/files/1687536842494-e6d3e4cf-7f7d-4321-99ee-a132de471602-image.png" alt="e6d3e4cf-7f7d-4321-99ee-a132de471602-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The response is 0.5MBytes. So you see 2.1MB of traffic because i tried 4 times, to call the same endpoint.</p>
]]></description><link>https://forum.netgate.com/post/1111986</link><guid isPermaLink="true">https://forum.netgate.com/post/1111986</guid><dc:creator><![CDATA[albgen]]></dc:creator><pubDate>Fri, 23 Jun 2023 16:15:41 GMT</pubDate></item><item><title><![CDATA[Reply to Slow NAT on Fri, 23 Jun 2023 15:55:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/albgen">@<bdi>albgen</bdi></a> Can you be more specific about the NAT setup and where the PC using the API is?  If you're also seeing packet loss or disconnects one possibility is an asymmetric routing issue, which is usually a config problem somewhere. (devices using different gateways, etc.)<br />
https://docs.netgate.com/pfsense/en/latest/troubleshooting/asymmetric-routing.html</p>
]]></description><link>https://forum.netgate.com/post/1111984</link><guid isPermaLink="true">https://forum.netgate.com/post/1111984</guid><dc:creator><![CDATA[SteveITS]]></dc:creator><pubDate>Fri, 23 Jun 2023 15:55:09 GMT</pubDate></item></channel></rss>