spithost I got a VPN working with OpenVPN on a very small QNAP NAS (we'll name it NAS1). NAS1 is situated behind a router with a fixed IP on which I have redirected ports on to NAS1. To this VPN I connect with different clients without any problem. I got a second (larger) QNAP NAS (we'll name that one NAS2) that also connects to that same VPN as a client and this also works perfectly. (The reason for this construction is that NAS2 is situated on a ship and connects to the internet through mobile internet which has changing "external IP's" plus that connection is behind carrier NAT", so I can't make NAS2 the VPN-server :-() Normally I'm on that ship so I can connect to NAS2 directly, but quite often I'm not and want to connect to NAS2 through a VPN to get to my files. If I want to connect to NAS2 from "outside", I will first have to figure out the VPN-IP that was given to NAS2 by NAS1 before I can connect through SMB to the shared drives of NAS2 with my VPN-client. On NAS1 I can reasonably easy figure this out manually by checking the active connections and then use the IP that is mentioned with the connection of NAS2 but this is somewhat annoying to do, every time I connect to the VPN on NAS1.... NAS2 also gets disconnected sometimes because of hickups in the mobile internet or for example when NAS1 or NAS2 reboot en NAS2 does a reconnect to the VPN on NAS1. And every time it reconnects, NAS2 gets an arbitray VPN IP from NAS1 which is more often different then the same as before the reconnect. And everytime that happens I first will have to figure out the (new) VPN-IP of NAS2 before I can continue using the files on NAS2 through SMB. Is there a way to (like with normal DHCP) "bind" a VPN IP to a specific device? So that NAS2 every time gets the same VPN-IP from NAS1 when it connects to the VPN? I know that with normal DHCP this is done based on the hardware-address of the NIC while with a VPN there IS no NIC, so that will propably be no option :-) Is it possible, for example, to "bind" a specific VPN-IP to a certain user that connects to the VPN? Then I can use a specific user for NAS2 to connect with resulting NAS2 getting the same VPN-IP everytime it connects. Or, maybe even better, put a unique "thingy" in the config of the VPN-client (NAS2) and VPN-server (NAS1) that could take care of binding?
mwandelaar I would advise you to take a look at the "Client-config-directive" or CCD to do this. Based on the CommonName of the client-certificate (in your case the certificate on NAS1) you can define your fixed ip. Take a look here