Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Double NAT

    Scheduled Pinned Locked Moved NAT
    27 Posts 5 Posters 6.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      Ofloo
      last edited by

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

      network.png
      WAN2.png
      WAN2.png_thumb
      network.png_thumb

      1 Reply Last reply Reply Quote 0
      • M
        mikeisfly
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • O
          Ofloo
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • DerelictD
            Derelict LAYER 8 Netgate
            last edited by

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

            Chattanooga, Tennessee, USA
            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
            Do Not Chat For Help! NO_WAN_EGRESS(TM)

            1 Reply Last reply Reply Quote 0
            • M
              mikeisfly
              last edited by

              Who is your ISP?

              1 Reply Last reply Reply Quote 0
              • O
                Ofloo
                last edited by

                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 192.168.10.10 IP

                If I setup netcat on IP 192.168.10.10, 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 127.0.0.0/8 to any port = isakmp -> 192.168.10.10 static-port
                nat on vr0 inet from 127.0.0.0/8 to any -> 192.168.10.10 port 1024:65535
                nat on vr0 inet from 172.16.1.0/24 to any port = isakmp -> 192.168.10.10 static-port
                nat on vr0 inet from 172.16.1.0/24 to any -> 192.168.10.10 port 1024:65535
                nat on vr0 inet from 192.168.1.0/24 to any port = isakmp -> 192.168.10.10 static-port
                nat on vr0 inet from 192.168.1.0/24 to any -> 192.168.10.10 port 1024:65535
                rdr on vr0 inet proto tcp from any to 192.168.10.10 port = 5060 -> 192.168.1.40
                rdr on vr0 inet proto udp from any to 192.168.10.10 port = 5060 -> 192.168.1.40
                rdr on vr1 inet proto tcp from any to 192.168.10.10 port = 5060 tag PFREFLECT -> 127.0.0.1 port 19000
                rdr on vr1 inet proto udp from any to 192.168.10.10 port = 5060 tag PFREFLECT -> 127.0.0.1 port 19000
                

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

                1 Reply Last reply Reply Quote 0
                • O
                  Ofloo
                  last edited by

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

                  from what i gather

                  tcp:

                  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.

                  edit:

                  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?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.