Double NAT

  • LAYER 8 Netgate

    You do not need outbound rules with only 1 WAN/default gateway.  pfSense is stateful.

    Reworded: The default rules are all you need.

    What's the corresponding firewall rule on WAN?

  • Euhm, I allow all traffic there's no rules needed, I guess I don't filter anything at this point.


    I need to verify something, .. maybe I thought of the reason, .. but not sure if this could be the cause. As  i said I have 2 pfsenses

    WAN => pfsense1 =>
    WAN => pfsense2 =>

    the pfsense1 does nat on that range and pfsense2 as well is and forwards traffic to the same range is that possible.

  • LAYER 8 Netgate

    No rules means no connections allowed into WAN.

  • No I have rules but allow any.

    IPv4 *	*	*	*	*	*	none
    IPv6 *	*	*	*	*	*	none	

    So I don't really see the point in adding an extra rule, that specifically allows that traffic, because allow any  should match all.

  • LAYER 8 Netgate

    No that's fine.  You'll have to figure out where the breakdown is then.  Check everything on the inside client (like its default gateway, firewall, etc.)

  • ok the idea is to add a sip trunk and backup sip trunk to have one go over one wan and the other over an other wan

    so basicly i forward the port 5060 to on both pfsense, the gateway for the is, however on the pfsense1 box I have a rule that when it matches the target IP it should use the pfsense2 as gateway so this should be fine.

    pfsense1 forward 5060 to
    pfsense1 if target IP and dport 5060 make it use gateway otherwise gateway
    pfsense2 forward 5060 to

    and finaly on both the same nat rules as above. I can reach the traffic up until pfsense2, so if i remove the forward rule and setup nc to listen on 5060 i can connect to it and send and receive data, however for some reason it doesn't want to forward that traffic to the

  • LAYER 8 Netgate

    I can't decipher that.  Draw a diagram.  See the one in my sig for the type of information you should include.

  • I understand, .. can you recommend a unix/linux program to do so.

  • Sip/rtp will not work with double nat. You will need a sip server or a sip and rtp proxy  on the firewall(or beside) to workaround it.

  • LAYER 8 Netgate

    It's hard enough with single NAT/PAT.

    For future reference:

    Free Diagramming Software:

  • That's the whole point SIP does work but it uses UDP, I wanted to give clients access to it using TCP cause in some networks UDP can't get passed a proxy, you need TCP but sip does work when it's using UDP it uses the same rules as TCP but for some reason TCP doesn't work.

    And I have a sip server

  • LAYER 8 Global Moderator

    "You do not need outbound rules with only 1 WAN/default gateway.  pfSense is stateful."

    Agreed.. But from his first few statements..
    "I've got a second cable modem with isp setup the isp for some reason doesn't want to provide bridge"

    But seems he using a different copy of pfsense, which is my bad for not reading it correctly.  But which is why I asked if 2 wan connections.
    "You have 2 wan connections right.."
    " What wan connection will it go out of - the normal wan, or this new double nat wan?"
    "If your traffic comes in in isp 2, and you send out the traffic in answer out isp 1?"

  • double, still working on that network map, have it ready in a bit

  • sorry not really good in these drawings tried to be as clear as possible

  • What ISP are you using, I may be able to help? Why not put your firewall in the DMZ of the ISP NAT device. Most of the time their DMZ will forward all unsolicited traffic to the DMZ IP.

  • The ISP nat is in dmz to, .. the target is the router, ..

  • LAYER 8 Netgate

    Aren't we just wasting time trying to double-NAT SIP?

  • Who is your ISP?

  • The ISP with the issue is Telenet it's european, .. and no where not wasting time trying to make sip work, sip already works it uses udp. I'm trying to forward a tcp port, with netcat listening on the end, if you want I can make it port 10000, but i don't think this will change the issue, .. why is portforward not working i think it's strange. It shouldn't matter if the traffic before it is NAT it has dmz all is forwarded, .. so why does the traffic stop at the IP

    If I setup netcat on IP, then I can connect to it, then if I forward the port, it can't connect, I'm pretty sure it's some configuration issue. But I wouldn't know where to start.

    # sysctl -a | grep forward
    kern.smp.forward_signal_enabled: 1
    net.inet.ip.forwarding: 1
    net.inet.ip.fastforwarding: 0
    net.inet6.ip6.forwarding: 1
    nat on vr0 inet from to any port = isakmp -> static-port
    nat on vr0 inet from to any -> port 1024:65535
    nat on vr0 inet from to any port = isakmp -> static-port
    nat on vr0 inet from to any -> port 1024:65535
    nat on vr0 inet from to any port = isakmp -> static-port
    nat on vr0 inet from to any -> port 1024:65535
    rdr on vr0 inet proto tcp from any to port = 5060 ->
    rdr on vr0 inet proto udp from any to port = 5060 ->
    rdr on vr1 inet proto tcp from any to port = 5060 tag PFREFLECT -> port 19000
    rdr on vr1 inet proto udp from any to port = 5060 tag PFREFLECT -> port 19000

    also i can connect to the ssh pfsense from the outside, however I can't forward it to any other ssh

  • I think I know what the problem is, .. however I'm not sure how to solve this

    from what i gather


    SYN =>
    <= SYN ACK
    ACK =>
    connection established

    however, ..

    WAN2 is a secundairy gateway while WAN1 is the default gateway, .. traffic is comming in through WAN2, however since the WAN1 is the default gateway of the client, it responds through WAN1, connection failed.

    Exactly like johnpoz said earlier.


    yes, if i change the route for that specific ip i can connect to the tcp, however now my question how can i make a dynamic route so that when I connect to it that traffic goes through the correct gateway. And that's why UDP works. It all makes sense now.

    can this be solved with a routing daemon?

Log in to reply