Access Ubuntu OpenVPN Client From Other Machines on Local LAN

This forum is for admins who are looking to build or expand their OpenVPN setup.

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
proam500
OpenVpn Newbie
Posts: 1
Joined: Mon Sep 11, 2023 3:40 am

Access Ubuntu OpenVPN Client From Other Machines on Local LAN

Post by proam500 » Mon Sep 11, 2023 3:43 am

I have an OpenVPN client running on an Ubuntu machine (192.168.107.1/24) and able to successfully connect to a remote OpenVPN server (10.0.0.1/24). The problem is when the client is connected, other machines on the local LAN (192.168.107.1/24) are unable to access that machine (ex: ssh into it, ping, etc). If possible, I would like to have all traffic from the OpenVPN client go through the VPN tunnel, look like it's connected to the remote LAN WAN address (to get around Netflix restrictions), have the client still be able to access resources on the local LAN and vice versa. Is this possible?

Kolusion
OpenVPN User
Posts: 20
Joined: Tue Sep 05, 2023 9:18 am

Re: Access Ubuntu OpenVPN Client From Other Machines on Local LAN

Post by Kolusion » Mon Sep 11, 2023 6:40 am

Yes, but you must bind your apps to the interface you want it to use. Some apps don't let you do this because they lack the feature.

The other way is to route traffic by port using iptables, which is ugly but it will work, but it will blanket route traffic for all apps that use that port.

You could use the 'if.up' feature of Network Manager to do this automatically with iptables whenever you connect to the VPN and 'if.down' for the reversal of iptables when you disconnect.

Kolusion
OpenVPN User
Posts: 20
Joined: Tue Sep 05, 2023 9:18 am

Re: Access Ubuntu OpenVPN Client From Other Machines on Local LAN

Post by Kolusion » Mon Sep 11, 2023 6:46 am

Or run another instance of Ubuntu in a virtual machine and run your VPN and Netflix in there. That will confine your VPN to the virtual machine and everything outside it will continue to run as normal.

VirtualBox is great virtual machine software.

Kolusion
OpenVPN User
Posts: 20
Joined: Tue Sep 05, 2023 9:18 am

Re: Access Ubuntu OpenVPN Client From Other Machines on Local LAN

Post by Kolusion » Mon Sep 11, 2023 6:50 am

You'll likely lack video hardware decoding inside the virtual machine though. Lol

Kolusion
OpenVPN User
Posts: 20
Joined: Tue Sep 05, 2023 9:18 am

Re: Access Ubuntu OpenVPN Client From Other Machines on Local LAN

Post by Kolusion » Mon Sep 11, 2023 7:00 am

Actually I am wrong. You will probably get hardware decoding but my experience with VirtualBox 3D acceleration is that it sucks hard. That's on Windows though. It might be better in Ubuntu.

Post Reply