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

    Lan to Lan NAT

    Scheduled Pinned Locked Moved NAT
    17 Posts 2 Posters 1.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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator @David01
      last edited by

      @david01 sure if for some reason the device on opt1 network will only allow access from the local opt1 network you could also do a source nat (outbound nat) so you get this

      192.168.110.x -- 192.168.110.y (pfsense) 172.19.25.41 -- 172.19.25.x

      So your 25.x guy hits 25.41, it gets forwarded to 192.168.110.x, outbound out of pfsense it changes it to look like its coming from 192.168.110.y

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.8, 24.11

      D 1 Reply Last reply Reply Quote 0
      • D
        David01 @johnpoz
        last edited by

        @johnpoz

        Thanks, That might be the winner, I couldn't spot any responses coming from 110.120 on opt 1 when jumping through 25.41 on opt2 using a port forward ( Inbound NAT ? ).

        I did try a outbound NAT earlier without any luck, I may have missed something in the config , Do you have any good examples you can point me towards please ?

        johnpozJ 1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @David01
          last edited by

          @david01 sure I could show you an example.. But its really late here, I will show a good example of this in the morning.. Pretty easy to setup.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          D 1 Reply Last reply Reply Quote 0
          • D
            David01 @johnpoz
            last edited by

            @johnpoz

            Thanks, I will check back tomorrow.

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @David01
              last edited by johnpoz

              @david01 ok here go..

              So I have 2 interfaces, my lan 192.168.9/24 and wlan 192.168.2/24

              Pfsense IP
              lan = 192.168.9.253
              wlan = 192.168.2.253

              Now I have a pc on lan 192.168.9.100, and AP on wlan with IP 192.168.2.2

              Now pfsense listens on 22, so couldn't use that port. So I setup a port forward on lan to port forward any traffic hitting 2222 on lan interface to 192.168.2.2 on 22

              Then I created outbound nat on wlan interface says translate any traffic from 192.168.9/24 to 192.168.2.2 to the IP of pfsense on wlan

              So when I send ssh traffic to 192.168.9.253 on port 2222, it gets sent to 192.168.2.2 22 and outbound changed to my pfsense IP 192.168.2.253

              You can see via the sniff on the wlan interface that traffic is sent to 192.168.2.2 from 192.168.2.253 vs my 192.168.9.100

              example.jpg

              If I sniff on the lan side I see 9.100 sending to 9.253, and answer

              lanside.jpg

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              D 1 Reply Last reply Reply Quote 0
              • D
                David01 @johnpoz
                last edited by David01

                @johnpoz Thanks for the reply !

                Did you set up the inbound and outbound to get bi-directional NAT ?

                I was thinking that was half of my issue so I tried a 1:1 NAT before I left the office again and failed,

                From what I've read at home I needed to select proxy ARP instead of IP Alias when setting up the virtual IP and add a firewall rule that allowed any to the virtual IP on Opt2, I would of thought the allow any to any rule would cover it.

                I wont be able to get back into the office until Sunday, I should be able to set it up remotely if the PC I left plugged in hasn't crashed but I need to physically be on the network to test,

                Im a little confused as to why you've set the Dest, Address on the port forward to LAN Address and the NAT IP to 2.2 and left the source as any, But that might just be the late hour here.

                johnpozJ 1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @David01
                  last edited by

                  @david01 no it is not directional, you would have to set that up if you wanted opt2 to create traffic to opt1..

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    David01 @johnpoz
                    last edited by

                    @johnpoz Ahh OK, 172.19.25.41 ---> 192.168.120.110 will be polled on port 502 and need to reply back on port 502 ( modbus )

                    johnpozJ 1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator @David01
                      last edited by

                      @david01 said in Lan to Lan NAT:

                      192.168.120.110 will be polled on port 502 and need to reply back on port 502 ( modbus )

                      That would just be allowed by the state that is created. You do not need to create rules for return traffic. You only need to create rules for unsolicited traffic.

                      Sorry for the late response - long weekend just got back..

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        David01 @johnpoz
                        last edited by

                        @johnpoz Sorry I didn't get back to you sooner,

                        I ran out of time to trouble shoot and ended up spinning up a quick ubuntu instance and doing a DNAT using IP tables.

                        I did run through your example without success, I could see the messages hitting the destination on the correct port but it wasn't replying for whatever reason.

                        Seems to work fine using a IP table, I guess the DNAT is successfully making it appear as the messages are originating from the 110.0 subnet and satisfying whatever siemens have going on.

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