Page 1 of 1

Clients Public IP wrong

Posted: Tue Sep 28, 2021 2:07 pm
by cacodemon79
Hi, I am trying to set up my openvpn network but I have a problem.

My LAN configuration is as follows:
- main router Zyxel acting as gateway (vdsl connection) and access point
- openwrt router TD-W8970 acting as access point and vpn server (

What I want to do is to create a VPN network with clients that must send internet requests only through my LAN gateway; in other words, I want that the clients public IP shown on internet is the one of my LAN gateway and not the one assigned to them by their ISP.

Here below my configuration:


user nobody
group nogroup
dev tun
port 1194
proto udp
topology subnet
keepalive 10 60
verb 3
push "persist-tun"
push "persist-key"
push "dhcp-option DNS"
push "dhcp-option DNS"
push "route"

ca /etc/easy-rsa/pki/ca.crt
cert /etc/easy-rsa/pki/issued/server.crt
key /etc/easy-rsa/pki/private/server.key
dh /etc/easy-rsa/pki/dh.pem
tls-auth /etc/easy-rsa/pki/ta.key 0


dev tun
proto udp
remote 1194 udp
resolv-retry infinite
user nobody
group nogroup

ca ca.crt
cert client1.crt
key client1.key
remote-cert-tls server
tls-auth ta.key 1

cipher AES-256-CBC
verb 3

The openvpn network is established correctly and the client is able to ping vpn server and navigate in Internet.

The problem is that the IP shown on Internet is the one assigned to client by its ISP and not the one of the LAN where the vpn server is located.

I tried to perform some changes in server configuration but with no success.

I also tried to put push "redirect-gateway def1" or push "redirect-gateway autolocal" but in this cases the client stopped to go to internet at all.

Can you please help me?

Thanks in advance :)