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

    SSH NAT to another network

    Scheduled Pinned Locked Moved NAT
    27 Posts 3 Posters 3.6k 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.
    • D
      dgiorgio
      last edited by

      sorry, but I did not understand how to do this.
      I have to make a routing on OpenWRT?

      192.168.0.0/24 -> 192.168.10.109

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

        So your pfsense natting and its network is behind a nat.

        so you have this publicIP - wrt 192.168.0.? –- 192.168.0.? wan pfsense lan -- 192.168.10.? ---- 192.168.10.109 SSH Server?

        So if you want to ssh in that sort of setup from where from the public internet then you would have to forward on wrt 22 to whatever that 192.168.0.x address is for pfsense wan, then on pfsense you would forward 22 to your 192.168.10.109 box.

        Your going to have issues if your on the 192.168.0 network and want to nat reflect, ie hit the public IP with asymmetrical routing.  In the case of wanting to ssh to 192.168.10.109 from boxes on the 192.168.0 network you would just hit your pfsense wan IP directly and let if forward.

        If your trying to use pfsense behind a nat, and for an openvpn server into your network directly behind your wrt router your going to have all kinds of asymmetrical routing problems without source natting your openvpn connections.

        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

        1 Reply Last reply Reply Quote 0
        • D
          dgiorgio
          last edited by

          OpenWRT does not use the network 192.168.0.X

          router: 192.168.0.1 (DHCP Server)
          PC: 192.168.0.100

          OpenWRT: 192.168.10.1 (DHCP Server)

          pfsense (VM Proxmox)
          wan: 192.168.0.132
          opt1: 192.168.10.109

          –-------------------------------

          I think that the connection does not work because the OpenWRT not find the ip source.

          will the OpenWRT seeks ip 192.168.0.100 to close the connection?

          if I do a routing, every connection to network 192.168.0.0/24 be redirected to the IP 192.168.10.109?

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

            What???  So your pfsense is a VM?

            Dude grab the napkin and the crayons and draw this..    Makes ZERO sense..

            What is connected to what?  Where is your wan/internet?

            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

            1 Reply Last reply Reply Quote 0
            • D
              dgiorgio
              last edited by

              in the first post I created a diagram

              pfsense is not the gateway, and does dhcp, I use pfsense to vpn, and to isolate networks.

              in this case it isolates the OpenWRT

              I have another interface on pfsense, LAN interface ip 192.168.100.1, it does dhcp to other VMs to isolate game servers.

              I did not put the LAN interface in the diagram, because it will be used in this case.

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

                Ok.. So you want to get to this openssh from where?  Your PC in you drawing or the internet?  You still need to create a port forward on pfsense.  to the openwrt IP.  Do you have gateway setup on wrt.  Is that connected to wrt wan?  Why is openwrt your dhcp server in this setup?  so 192.168.10.1 is openwrt LAN IP?  And there is nothing behind openwrt - what purpose is it then?  Wireless? It sure can not be the gateway off the 192.168.10 network.

                So if you want to get to it from your PC you have to hit your pfsense wan IP on that port 2222, for openwrt to be able to talk back it needs to have a gateway setup that would be pfsense IP in that network 192.168.10.109

                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

                1 Reply Last reply Reply Quote 0
                • D
                  dgiorgio
                  last edited by

                  got it!

                  I got to change the settings, and set DHCP on opt1 interface, OpenWRT was set to get IP by DHCP.

                  that way it worked!

                  so I can let the dhcp on OpenWRT and set the 192.168.0.109 (pfsense) as the gateway.

                  I'll try.

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

                    What possible reason do you want/need wrt to be dhcp server?

                    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

                    1 Reply Last reply Reply Quote 0
                    • D
                      dgiorgio
                      last edited by

                      because it is not always this router is in my house.

                      1 Reply Last reply Reply Quote 0
                      • D
                        dgiorgio
                        last edited by

                        ready

                        worked, set up the dhcp of the OpenWRT, I put the pfsense as gateway.

                        the dns I put 192.168.10.1 and 8.8.8.8

                        it's working!
                        OpenWRT has internet access, and I can connect via "PC".

                        Thank you all

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

                          Why do you have wrt as dhcp server?  Makes no freaking sense to me at all, why would you not have pfsense be your dhcp server for this 192.168.10 network?

                          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

                          1 Reply Last reply Reply Quote 0
                          • D
                            dgiorgio
                            last edited by

                            sometimes I take this router to other places, it is not fixed in my house.

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

                              Ok… if you do that then turn on its dhcp server ;)

                              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

                              1 Reply Last reply Reply Quote 0
                              • D
                                dgiorgio
                                last edited by

                                true, you're right.

                                I put the dhcp again in pfsense.  8)

                                Tks

                                1 Reply Last reply Reply Quote 0
                                • D
                                  dgiorgio
                                  last edited by

                                  I just do not want the network 192.168.10.0 to access the network 192.168.0.0

                                  but I think this is for another topic.

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    dgiorgio
                                    last edited by

                                    I created a new topic to isolate the network 192.168.10.0

                                    https://forum.pfsense.org/index.php?topic=118803.0

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