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

Access device via openvpn through ipsec tunnel

Scheduled Pinned Locked Moved IPsec
ipsec routingopenvpn config
11 Posts 2 Posters 1.3k 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.
  • N
    nick.loenders
    last edited by Nov 22, 2022, 9:17 AM

    Hi,

    I am connect to FW1 using openvpn and have an ip in range 10.10.10.0/24

    The LAN at FW1 is in range 10.0.1.0/24 and I can reach devices in that range.
    The WAN ip is in range 192.168.0.0/24

    But there is an ipsec tunnel between FW1 and FW2 using the real public ip's , eg 81.84.100.102 and 81.86.145.120

    FW2's local LAN is 10.0.2.0/24, the WAN ip is also in range 192.168.0.0/24

    The WAN ip's are in 192.168 as these are dynamic public ip's and the modem than has a dhcp to the firewalls. These ip's rarely change, so the ipsec tunnels should work for a long time. It only changes if the modem might be offline for a long time.

    So the ipsec tunnel is also working.

    BUT, if I try to reach the range 10.0.2.0/24 through the openvpn, so from my laptop, it responds with: COMPUTER SAYS NO.

    How can I make it possible I can reach from my laptop to a device on the second firewall?

    V 1 Reply Last reply Nov 22, 2022, 1:38 PM Reply Quote 0
    • V
      viragomann @nick.loenders
      last edited by Nov 22, 2022, 1:38 PM

      @nick-loenders said in Access device via openvpn through ipsec tunnel:

      FW2's local LAN is 10.0.2.0/24

      You need to add this network to the "Local networks" in the OpenVPN server settings to push the route to the client.

      Further in IPSec you have to add an additional phase 2 tunnel to connect the site 2 LAN with the OpenVPN tunnel network.

      So on FW1 set
      Local network: 10.10.10.0/24
      remote network: 10.0.2.0/24
      and on FW2 the other way round.

      N 1 Reply Last reply Nov 22, 2022, 1:41 PM Reply Quote 0
      • N
        nick.loenders @viragomann
        last edited by Nov 22, 2022, 1:41 PM

        @viragomann

        In openpvn server, I have the settings like that.

        In the ipsec, I have to have two P2's then ? 1 with local subnet LAN and one local subnet the 10.10.10 ?

        V 1 Reply Last reply Nov 22, 2022, 1:43 PM Reply Quote 0
        • V
          viragomann @nick.loenders
          last edited by Nov 22, 2022, 1:43 PM

          @nick-loenders
          Yes. You need the second p2 also on FW2 to establish the tunnel.

          N 1 Reply Last reply Nov 22, 2022, 2:19 PM Reply Quote 0
          • N
            nick.loenders @viragomann
            last edited by nick.loenders Nov 22, 2022, 2:20 PM Nov 22, 2022, 2:19 PM

            @viragomann

            So on FW1:
            75923856-0f97-4f36-bf23-d565a95f404b-image.png

            On FW2:

            608a10e6-9fda-451c-8fc6-b91d1655f235-image.png

            And in the openvpn on FW1:

            0dd89501-be42-45cc-adc0-0ef402924def-image.png

            I get a request timed out when I try to ping the device on site 1, allthough the firewall says it is ok:
            fe98dfbe-c199-474f-b5c7-a7bbdc44cbe4-image.png

            Also for the ping to the device on site 2 :
            3b734ad9-c59b-4f3f-a4ce-0f4686602f13-image.png

            But I cannot ping it, or visit the webpage?? :(

            Strangest thing is, before I could ping/access the device on site 1 ?

            V 1 Reply Last reply Nov 22, 2022, 2:29 PM Reply Quote 0
            • V
              viragomann @nick.loenders
              last edited by Nov 22, 2022, 2:29 PM

              @nick-loenders
              Why did you state 10.0.0.0/8 in your p2 for the remote site? And that on both sites.
              That cannot work since the networks are overlapping.

              Configure the phase 2 with the correct networks.

              N 1 Reply Last reply Nov 22, 2022, 2:36 PM Reply Quote 1
              • N
                nick.loenders @viragomann
                last edited by Nov 22, 2022, 2:36 PM

                @viragomann

                So, on site 1:
                f37cb8ef-12fe-45a0-9fdb-e6a7241b17c8-image.png

                On site 2:
                9140013a-7e5a-4f86-807f-ff1768a83fd1-image.png

                What if I have 8 sites? I cannot never do 10.0.0.0/8 on site 1 ?

                V 1 Reply Last reply Nov 22, 2022, 2:56 PM Reply Quote 0
                • V
                  viragomann @nick.loenders
                  last edited by Nov 22, 2022, 2:56 PM

                  @nick-loenders said in Access device via openvpn through ipsec tunnel:

                  I cannot never do 10.0.0.0/8 on site 1 ?

                  You can, but not if it's overlapping the local networks on the other site.

                  10.0.1.0/24 and 10.0.2.0/24 are both parts of 10.0.0.0/8. So if you state this in the p2 pfSense cannot route.

                  N 1 Reply Last reply Nov 22, 2022, 3:08 PM Reply Quote 0
                  • N
                    nick.loenders @viragomann
                    last edited by Nov 22, 2022, 3:08 PM

                    @viragomann

                    First to let you know it worked, for the 2 sites.
                    But for more sites, I need to do this then on site1:

                    aff5464e-abbc-477d-a206-37b83f03376f-image.png

                    N 1 Reply Last reply Nov 22, 2022, 3:27 PM Reply Quote 0
                    • N
                      nick.loenders @nick.loenders
                      last edited by Nov 22, 2022, 3:27 PM

                      @viragomann
                      Nevermind the previous post... this is to another public ip, so is another P1 off course

                      V 1 Reply Last reply Nov 22, 2022, 3:41 PM Reply Quote 0
                      • V
                        viragomann @nick.loenders
                        last edited by Nov 22, 2022, 3:41 PM

                        @nick-loenders
                        Anyway, if you have sequenced subnets like these you can embrace them in the p2 using an appropriate mask. But with a local LAN of 10.0.1.0/24 you run into risk of overlapping.

                        So if the LAN here is 10.0.1.0/24 you could only merge tunnel 2 and 3 by stating 10.0.2.0/23 as the remote network.

                        If you have control over all involved site you should consider this when designing the networks.

                        1 Reply Last reply Reply Quote 0
                        11 out of 11
                        • First post
                          11/11
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                          This community forum collects and processes your personal information.
                          consent.not_received