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

    VPN IPSec - one site has a dynamic ip

    Scheduled Pinned Locked Moved IPsec
    7 Posts 4 Posters 11.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.
    • K
      kts-tec
      last edited by

      Hello,

      we need a VPN tunnel between our headquarter and a branch office.
      On our headquarter site we have a PFSense and in the branch office a lancom vpn router
      The PFSense has a static ip adress, the branch office not. We can not use a dyndns.

      How can i get the VPN IPsec tunnel to work with a dynamic ip?
      The VPN Router in the branch office can establish the connection, because in this direction we have a static ip.
      Is this enough and what ip should i enter in the P1 remote gateway field on the pfsense? (0.0.0.0)?

      Thanks for your help.
      Best regards,
      Steffen

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

        Why can you not use dynamic DNS?

        Try setting the remote gateway on the pfSense side to 0.0.0.0. You will also want to set the pfSense side to responder only since it will never be able to initiate a connection to the other side as it will never know what hostname/IP address to initiate a connection to.

        You will need to set the Remote identifier on the pfSense side to match the local identifier on the lancom side. I would use something like type Distinguished Name with a value like lancom.broken.ipsec on each side. This might take some experimenting to find an identifier type that both agree upon and work with. The IPsec logs in Status > System Logs will probably be of help here.

        Note that you can only use 0.0.0.0 to connect to one remote site. To connect more you'll need at least DynDNS. Static addresses are, of course, better.

        OpenVPN servers can receive connections from arbitrary IP addresses all day every day.

        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
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by johnpoz

          @derelict said in VPN IPSec - one site has a dynamic ip:

          Why can you not use dynamic DNS?

          The lancom's support it
          https://www2.lancom.de/kb.nsf/1276/A7D863B0F32A8A39C1257DD400378A2F?OpenDocument
          Configuring a dynamic DNS service in LANCOM routers

          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
          • K
            kts-tec
            last edited by

            Thank you for your answer.

            the problem is, that we are not the owner of the internet connection in the branch office. At the moment i dont know if we can use DynDNS for this IP - i have to check this with the IT of the company that owns the internet connection.

            I did some tests with the VPN connection and there is one problem. Maybe you can help me with this.

            Configuration 1:
            Lancom IPSec v1 internal Identifier set to ASN1 Distinguished Name with the Value 10
            Lancom IPSec v1 external Identifier set to IPv4 with the value of the static IP Address of the PFSense
            PFSense v1 remote Gateway set to 0.0.0.0
            PFSense v1 My identifier set to IP address with the value of the static IP Address of the PFSense
            PFSense v1 Peer identifier set to ASN.1 Distinguished Name with the Value 10
            The Result is: No Connection. The Lancom can not establish the connection and i get the error "ike_phase_1_send_ID: could not get AS.1 ID for <10>"
            x509_DN_conf_get: x509_string_DN() failed
            x509_string_DN: x509_string XN() failed
            x509_string_XN: attribute type without value

            Configuratoin 2:
            Lancom IPSec v1 internal Identifier set to IPv4 with the value of the dynamic IP Address of the Lancom
            Lancom IPSec v1 external Identifier set to IPv4 with the value of the static IP Address of the PFSense
            PFSense v1 remote Gateway set to the dynamic IP Address of the lancom
            PFSense v1 My identifier set to IP address with the value of the static IP Address of the PFSense
            PFSense v1 Peer identifier set to IP address with the value of the dynamic IP Address of the Lancom
            The Result is: Connection established

            Configuratoin 2:
            Lancom IPSec v1 internal Identifier set to IPv4 with the value of the dynamic IP Address of the Lancom
            Lancom IPSec v1 external Identifier set to IPv4 with the value of the static IP Address of the PFSense
            PFSense v1 remote Gateway set to 0.0.0.0
            PFSense v1 My identifier set to IP address with the value of the static IP Address of the PFSense
            PFSense v1 Peer identifier set to IP address with the value of the dynamic IP Address of the Lancom
            The Result is: No Connection

            There are two questions.
            How should i configure the identifier?
            Any Idea how i can get the connection established without the remote gateway ip?

            Thanks and best regards

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

              @kts-tec said in VPN IPSec - one site has a dynamic ip:

              that we are not the owner of the internet connection in the branch office.

              That doesn't mean anything - all an dyndns does is point a fqdn to the IP... Unless you have the IPs from say ARIN pretty much nobody owns their IPs... Especially home users - and you can point a dyndns name to the IP ;)

              Be like saying only lease the car - so can not name it Fred if you wanted too..

              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
              • K
                kts-tec
                last edited by

                On the lancom i can set the identifier to mail (fqun).
                I dont find a identifier on the pfsense for mail (fqun). Is it possible to use a fqun on the pfsense as identifier?

                I'm talking about the dyndns with the it department.

                B 1 Reply Last reply Reply Quote 0
                • B
                  brians @kts-tec
                  last edited by

                  @kts-tec said in VPN IPSec - one site has a dynamic ip:

                  On the lancom i can set the identifier to mail (fqun).
                  I dont find a identifier on the pfsense for mail (fqun). Is it possible to use a fqun on the pfsense as identifier?

                  I'm talking about the dyndns with the it department.

                  In phase1, select my identifier, or peer identifier, and all options are there.

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