Problem with connection after assigning a client fixed ip

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
ekachaiz
OpenVpn Newbie
Posts: 6
Joined: Wed Apr 19, 2017 8:20 am

Problem with connection after assigning a client fixed ip

Post by ekachaiz » Sun Apr 23, 2017 5:47 am

Hi guy, I have been trying to figure this out for 2 days now but still cant get it to work. Im currently using My Asus router as Openvpn server with configuration below. There are 3 clients connect to the server. Everything works fine under this setting until i try to assign a static ip to one of the client. I have added a file "user01" to ccd folder. The "user01" ip address shown according to my setting but internet connection and connection between other clients become impossible. Im not sure what I've done wrong here. It would be much appreciated if anyone could point out my mistake here. I've read the topology subnet topic but still not quite sure if im understand correctly.


SERVER configuration
# Automatically generated configuration
daemon
server 10.8.0.0 255.255.255.0
proto udp
multihome
port 1194
dev tun21
cipher AES-256-CBC
comp-lzo adaptive
keepalive 15 60
verb 3
push "route 192.168.2.0 255.255.255.0 vpn_gateway 500"
client-config-dir ccd
client-to-client
duplicate-cn
push "dhcp-option DNS 192.168.2.1"
push "redirect-gateway def1"
plugin /usr/lib/openvpn-plugin-auth-pam.so openvpn
client-cert-not-required
username-as-common-name
ca ca.crt
dh dh.pem
cert server.crt
key server.key
status-version 2
status status 10


Client configuration
USER01


ifconfig-push 10.8.0.1 10.8.0.2

TiTex
OpenVPN Super User
Posts: 310
Joined: Tue Apr 12, 2011 6:22 am

Re: Problem with connection after assigning a client fixed ip

Post by TiTex » Sun Apr 23, 2017 7:39 am

i think this should be reversed

Code: Select all

ifconfig-push 10.8.0.1 10.8.0.2
but you should not use the first /30 subnet for fixed IP in topology net30
try

Code: Select all

ifconfig-push 10.8.0.10 10.8.0.9
this is from the clients prespective so the first IP is the local enpoint (Client IP) , second is the server's IP

also , it's recommended to use 'topology subnet' instead of the default 'topology net30'
https://community.openvpn.net/openvpn/wiki/Topology

Post Reply