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

    Using OpenVPN with Virtual IP Address

    Scheduled Pinned Locked Moved OpenVPN
    9 Posts 4 Posters 5.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.
    • C
      codera
      last edited by

      Hi!

      How can i use OpenVPN with Virtual IP Address? I have a static IP´s subnet from ISP. One ip is used on the default WAN interface and i also added a second IP to Virtual IP Address as  IP Alias.
      What is the correct setup for making OpenVPN work with that IP, not the one, that is used by default WAN interface?

      Also i would like to have the OpenVPN outgoing connection using the same virtual IP address. As i understand that this can be done at Firewall / NAT / Outbound.

      1 Reply Last reply Reply Quote 0
      • V
        viragomann
        last edited by

        Now, do you have an openvpn server or a client or both?

        1 Reply Last reply Reply Quote 0
        • S
          Symon
          last edited by

          You set up the virtual IP in Firewall -> Virtual IP . Then, in the VPN -> OpenVPN section, when you set up the server or client, choose the Virtual IP you made in the interface drop down. If it's a server, make sure you have a rule in Firewall -> Rules on the WAN to let stuff through.

          1 Reply Last reply Reply Quote 0
          • C
            codera
            last edited by

            @viragomann:

            Now, do you have an openvpn server or a client or both?

            Yes, only openvpn server.

            1 Reply Last reply Reply Quote 0
            • C
              codera
              last edited by

              @Symon:

              You set up the virtual IP in Firewall -> Virtual IP . Then, in the VPN -> OpenVPN section, when you set up the server or client, choose the Virtual IP you made in the interface drop down. If it's a server, make sure you have a rule in Firewall -> Rules on the WAN to let stuff through.

              Virtual IP is added already.
              I need to set up the server. Does all the need rules get created automatically or do i need to change/add some rule?
              I used the wizard and if a remember correctly, i already chose the virtual ip but after trying to connect from client i got an error, indication a message, the client could not connect.

              I´ll try to set it up again.

              1 Reply Last reply Reply Quote 0
              • V
                viragomann
                last edited by

                The wizard will have set the firewall rule for the WAN IP. So edit that rule and select the virtual IP at destination instead.
                Also set the server to listen to the virtual IP as suggested by Symon.

                1 Reply Last reply Reply Quote 0
                • C
                  codera
                  last edited by

                  When i set up the interface, at the wizard, in step 9, i can only choose WAN, the virtual IP interface is not shown.

                  After the wizard is done, i can go and edit the server options and change the interface from WAN to virtual IP. After i save it, i do not think the firewall rules get also changed?
                  When i manually go to firewall rules and try to edit, the interface or destination, that are both set as WAN right know, i also do not see the virtual IP?

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

                    You'll have to post your VIP configuration. If defined properly you will be able to choose the VIP in the interface selector in the server config. If you cannot do that it is because the VIP is configured incorrectly.

                    As has already been said, you need to be sure that the OpenVPN traffic is passed into wan to the VIP. This is UDP/1194 by default.

                    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
                    • C
                      codera
                      last edited by

                      Well i tried to configure openVPN using my default WAN adapter. I had some weird issues, i got errors after configuring openvpn and pfSense admin page displayd some filter reload erros. Also after restart i had no internet connection on my lan devices.
                      So i took the openVPN server down and removed all the firewall rules and did a fresh restart. After that, when i set up openVPN again, on the default WAN interface, at lease i got it to work.
                      Weird is also the fact, that this is almost a fresh installation, i havent really configure anything.

                      I think this was the issue with the virtual IP also, but i am going to reconfigure the openVPN when i have enough free time.

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