Client source address

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
iddqd_x
OpenVpn Newbie
Posts: 2
Joined: Fri Mar 26, 2021 1:31 pm

Client source address

Post by iddqd_x » Fri Mar 26, 2021 1:47 pm

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!

iddqd_x
OpenVpn Newbie
Posts: 2
Joined: Fri Mar 26, 2021 1:31 pm

Re: Client source address

Post by iddqd_x » Sat Mar 27, 2021 11:14 pm

Solved.
You need to enter at least 15 characters

remre
OpenVpn Newbie
Posts: 6
Joined: Wed Dec 09, 2020 12:15 am

Re: Client source address

Post by remre » Sat Apr 03, 2021 7:31 pm

Explain please to share experience.

Post Reply