Page 1 of 1

Client source address

Posted: Fri Mar 26, 2021 1:47 pm
by iddqd_x
Hello OVPN community!

I've several VPS in cloud (cloud has own virtual subnet 10.0.0.0/24).
One of the VPS is OpenVPN server running Debian Linux with 172.16.16.0/24 subnet. Server internal IP is 10.0.0.13
Everything works fine.

Config is pretty standard

Code: Select all

port 1194
proto udp
dev tun
server 172.16.16.0 255.255.255.0
I don't use "redirect-gateway def1 bypass-dhcp" as I need only to access internal network.

iptables config

Code: Select all

-A INPUT -i eth0 -p udp -m state --state NEW -m udp --dport 1194 -j ACCEPT
-A POSTROUTING -s 172.16.16.0/24 -o eth0 -j MASQUERADE
Problem: when I connect (SSH) to another VPS 10.0.0.7 via VPN it shows me "Last login: Fri Mar 26 13:17:16 2021 from 10.0.0.13". This is how it should be as I use MASQUERADE. Is it possible to get real/source IP address of the VPN client with his assigned IP address from 172.16.16.0/24 subnet?

Thanks!

Re: Client source address

Posted: Sat Mar 27, 2021 11:14 pm
by iddqd_x
Solved.
You need to enter at least 15 characters

Re: Client source address

Posted: Sat Apr 03, 2021 7:31 pm
by remre
Explain please to share experience.