How to assign statis ip for certain OpenVPN users?
-
Hello,
I have posted this question on OpenVPN section about a week ago, but didn't get any reply, so I posted it here.
I have OpenVPN that is working okay. But I want to assign statis ip for some of our vpn users.
In OpenVPN Server / Clients Settings/ Toloplogy - Subnet - One IP address per client in a common subnet.
In Client Specific Overrides I entered these:
Common name of vpn user certificate - user
Pv4 Tunnel Network - 192.168.5.5 (which I want to get this ip)
IPv4 Local Network/s - 192.168.1.0/24 (user can see our network)
Redirect Gateway - Force all client generated traffic through the tunnel.User gets ip 192.168.5.5 but can't see our network and can't ping 192.168.5.1 (vpn virtual network)
I also added ifconfig-push 192.168.5.5 255.255.255.0; to Advanced. But couldn't get what we want. Please help me to solve this.
-
You were close. You were missing the proper subnet mask.
Leave IPv4 Local Networks(s) blank and add your custom stuff under IPv4 Tunnel Network like this:
a.b.c.d/30
For example, one of my users is set to 192.168.2.4/30 which means (I think) .4 for the network address, .5 for the gateway address, .6 for the actual IP address and .7 for the broadcast address. My next user is 192.168.2.8/30 which gives him an IP address of 192.168.2.10. Separate each user by 4.