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

    1:1 NAT problem - Outgoing traffic uses general Outbound NAT

    Scheduled Pinned Locked Moved NAT
    16 Posts 2 Posters 10.5k 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.
    • jimpJ
      jimp Rebel Alliance Developer Netgate
      last edited by

      I'm not too familiar with the vge (VIA gigabit ethernet) cards, you could possibly be hitting a driver bug of some kind.

      It would be worth trying a 2.0 snapshot to see if the behavior is similar with the updated drivers therein.

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • T
        tata_tulen
        last edited by

        Do you think it's driver-related issue? Could it be a configuration-related problem? I cannot simulate this scenario on 2.0 with the vge cards, the 1.2.3 box is SPoF :( I'll ask our "Virtual" team if we'll be able to simulate this scenario in virtual environment just to ensure it's not configuration or concept issue, will it be helpful?

        -tt-

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          Well the promisc issue might be a driver bug, or you could be using something that is putting that interface into promisc mode (rate/traffic graph view, packet capture, etc)

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • T
            tata_tulen
            last edited by

            Oops, I've just notices the PROMISC mode is gone :-o The only thing I've done was save configuration of OPT1 iface (no change, just click tha save button by mistake). However, no change in the behavior… I'm not sure if the virtual environment test will be possible, I'm not sure if there is suport for tagged traffic in the VM - at least I'll make proof of concept with standard interfaces (not-tagged)...

            -tt-

            1 Reply Last reply Reply Quote 0
            • T
              tata_tulen
              last edited by

              Maybe I was run the ifconfig command with tcpdump commadn running in the second window - it would explain the PROMISC mode, wouldn't it?

              -tt-

              1 Reply Last reply Reply Quote 0
              • T
                tata_tulen
                last edited by

                I've done some more research and it seems as pfSense "absobloodylutely" ignore the second 1:1 NAT rule and "transforms" it to just PAT (port forwarding). I'll try to describe problem in more detail.

                The postfix box have two interfaces (eth0, eth3) in the same VLAN/subnet. Default route goes through eth0 iface to the IP of pfSense's LAN iface. There are two instances of Postfix - first default binded to eth0 iface [192.168.100.5, 127.0.0.1], and second modified dinded to eth3 iface [192.168.100.12]. On pfSense there are two 1:1 NAT rules:

                VIP1 (WAN iface) [x.y.58.6] <–> internal Postfix eth0 iface [192.168.100.5]
                VIP2 (OPT1 iface) [x.y.58.70] <–> internal Postfix eth3 iface [192.168.100.12]

                In this state, the smtp flow from default instance of Postfix (at eth0) is correctly NATed to the VIP1, however the smtp flow from the second Postfix instance is incorrectly NATed by the default Outbound NAT to the pfSense's WAN iface IP [x.y.58.24]

                But when I tried to change the default gw on Postfix server to go through eth3, all outbound traffic from the Postfix server is NATed to the pfSense's WAN iface IP [x.y.58.24] and moreover - the incomming traffic from internet stop work (with no entry in the pfSense's Firewall log)….

                I'm relly confused by this behaviour and cannot realize no explanation with my knowledge... :-(

                -tt-

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  That sheds some light on what might be the problem.

                  Run tcpdump on the postfix box. I bet it's sending the traffic back out the wrong IP.

                  Having two interfaces on the same subnet doesn't work like you might expect. It might work better with two IPs on a single interface, but you also need to consider that outbound NAT does not direct traffic out a certain way, you need a policy route rule to direct traffic as well. Usually reply-to would handle traffic from incoming connections, so I suspect the OS on that mail server may not be doing what you think it should be doing.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • T
                    tata_tulen
                    last edited by

                    tcpdump shows the smtp traffic from second instance of Postfix with source 192.168.100.12, as expected - the instance is binded to the eth3 with that IP. I'm going to temporarily remove the first 1:1 NAT rule for the first instance of Postfix this late evening to check the second 1:1 NAT itself and I'll let you know.

                    By "two IPs on a single iface" you mean virtual iface like eth0.1? I had it configuraed this way before with the same behaviour…

                    -tt-

                    1 Reply Last reply Reply Quote 0
                    • T
                      tata_tulen
                      last edited by

                      I've just tried to remove the first NAT and the second doesn't work. Maybe I found the reason - both postfix addresses are translated to the same MAC address (to the eth0's one). I've tried to make static entry in ARP table with the correct MAC, however it doesn't work - no ping reply :(

                      Well, pfSense seems to choose the appropriate NAT rule according to the L2/ethernet header source (and then ARP table entry) instead of the L3/IP header source. Am I right? Is there any way to solve this?

                      Thanks!

                      -tt-

                      1 Reply Last reply Reply Quote 0
                      • T
                        tata_tulen
                        last edited by

                        Hi,

                        as I expected - creating dedicated Postfix replacing the second instance on the first server solve the problem (the ARP entries on pfSense for [192.168.100.5] and [192.168.100.12] are now different).

                        However, I still do not understand the principles of how pfSense is building an outgouing NAT. Jimp, please, can you explain int for me?

                        Thanks!

                        -tt-

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