Assigning static IP address to VPN clients

I've got Mavericks server with VPN access up and running. The clients can connect to it just fine.


The issue is we want to give the VPN clients static IPs for the VPN connections.


It looks as if setting up a static IP for the clients is simple but it doesn't work.


On the client

1) Open System preferences

2) Click network preferences icon

3) Click on the VPN service

4) Click the advanced settings button

5) Click the TCP/IP tab

6) Set Configure IPv4: to manually

7) Enter the IP address etc you want the client Mac to have when connected to the VPN service


After doing all of the above the client Mac ignores the static IP settings I give it and still gets an address assigned by the Mavericks server when connecting to the VPN.


Am I doing something wrong here or is this feature broken?

Posted on Jul 30, 2014 8:23 AM

Reply
5 replies

Aug 5, 2014 10:04 AM in response to Mattula

The Apple VPN server in Server.app is very simple to set up but is extremely limited in what it can do. Therefore if you are going to use the Apple VPN server the answer is usually no and in this case categorically no.


What you want to do might be possible using an alternative VPN server solution with the consequence of it being more complicated to set up. I believe for example that it might be possible using StrongSwan5. The Apple VPN server requires you to use a block of IP addresses that is not part of your normal DHCP block, this means the addresses are then issued by the VPN server itself and due to its simplicity it gives you no control over this process. With StrongSwan5 however you can chose to have your real DHCP server issue the IP addresses for the VPN clients and then in theory you should be able to get the real DHCP server to do DHCP reservations aka. static DHCP maps for the clients.


I have not done this myself with StrongSwan5 but I believe the configuration lines you would need would be as follows


First in /etc/strongswan.conf you need something like the following


strongswan.conf:

charon {  
        dns1=xxx.xxx.xxx.xxx                    # IP address of the DNS server that you want your client to use  
        load=charon nonce pem openssl random attr kernel-netlink socket-default farp stroke updown xauth-generic xauth-noauth dhcp  
          # The above line loads necessary modules for strongswan, if you want DHCP to work you must load dhcp  
          # and farp modules  
  
        plugins {  
                dhcp {  
                        server = xxx.xxx.xxx.xxx    # IP address of DHCP server to request for IP address.  
                }  
        }  
}


Then in /etc/ipsec.conf you need something like the following (and other bits)



conn vpn  
.............
        rightsubnet=yyy.yyy.yyy.0/24     # This points to the subnet of your linux box.  
        rightsourceip=%dhcp          # Thiss ask DHCP server to assign address for you.


Why do you need static addresses?

Aug 5, 2014 5:24 PM in response to John Lockwood

John Lockwood wrote:


The Apple VPN server in Server.app is very simple to set up but is extremely limited in what it can do. Therefore if you are going to use the Apple VPN server the answer is usually no and in this case categorically no.


What you want to do might be possible using an alternative VPN server solution with the consequence of it being more complicated to set up....


Ayup, a firewall-based VPN server is the usual preference for small networks. That for various reasons, too.

Aug 7, 2014 7:23 PM in response to John Lockwood

Thanks for providing an alternative VPN solution.


If you follow the steps in my first post OSX server actually does allow you to set a static IP for the VPN connection. Unfortunately it doesn't work and hasn't worked for years.


Why we need static IP addresses for VPN connections...

We do not have any forward facing servers. The only way we can access our servers is via a VPN connection for security reasons. Bonjour does not work over a VPN connection. We need the ability to screen share undetected with all clients on our network, including the remote clients connected via VPN. Apple Remote Desktop needs Bonjour to find the clients on the network. The workaround is to make the VPN clients connect with a static IP address and enter that IP into ARD.


Our router actually has the ability to create a VPN server but we like OSX server's ability to manage VPN connections, passwords, etc by simply modifying the profile for that network user.


Any suggestions for screen sharing software that works with VPN connected clients, something that doesn't require Bonjour?

Aug 7, 2014 7:39 PM in response to Slowmac

I used Apple Remote Desktop to support VPN users for years although it maybe harder now. With older Apple server software the VPN module used to list active connections along with the IP address assigned to them (the current version does not). It was then possible to in ARD define a scanner for that single IP address, find the client, and connect to it. In theory the same approach by searching the VPN log for the connection and its assigned IP address should work. You can always ask the user to go to System Preferences -> Networking to find and read out to you the VPN client address as well.


It may also be possible to define a scanner in ARD that scans the entire range of IP addresses reserved for VPN clients. Remember that with Apple's VPN server you are supposed to use a block that does not overlap any block assigned by your DHCP server. ARD can scan via Bonjour (local only as you are aware), via individual IP address, or by a range of IP addresses.


Finally, once a Mac has previously been found and added to the ARD database then it will auto-update the IP address of that client in the computer list in ARD, however I do believe this is not as successful for VPN clients in this manner, it does work fine for remote site-to-site VPN connected clients.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Assigning static IP address to VPN clients

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.