Assign client same ip address as static address on router network

Need help configuring your VPN? Just post here and you'll get that help.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
jameszp
OpenVpn Newbie
Posts: 3
Joined: Sat May 27, 2023 7:49 pm

Assign client same ip address as static address on router network

Post by jameszp » Tue Jun 06, 2023 3:02 pm

I have an OpenVPN server running on a machine behind my home router, and two clients, one Macbook and one iPhone.

When I'm not using OpenVPN, I can statically assign IP addresses to the Macbook and iPhone, 192.168.X.* through the router web interface and the device network settings. The configuration I'm using for OpenVPN is the 10.8.0.0 network with the server running on 10.8.0.1 and the two clients statically assigned IPs from client-config-dir in the range 10.8.0.*.

The setup that I have uses the tun interface, and I'm able to forward all internet traffic perfectly with all the devices mentioned. I'm able to ssh from my clients to the devices inside my 192.168.X.* LAN network, but I would like to be able to ssh from machines on my LAN network to the OpenVPN clients using the 192.168.X.* addresses rather than using 10.8.0.*. I have the /etc/hosts hostname pointing to the 192.168.X.* address when resolving the hostname.

I have seen online that OpenVPN does not support tap tunnels on iOS, so I'm not sure if ethernet bridging would be a solution.

Is there a way to give the clients the same static IP addresses on 192.168.X.* when they are connected through OpenVPN? I would like to be able to access these devices with the same static ip whether the OpenVPN is used or not. I would be more than happy to provide additional details as necessary!

Post Reply