You are here
Juan - Mon, 2025/04/14 - 11:45
I need to print to a printer connected to the local network with a computer connected to the same network that uses OpenVPN to connect to an external domain.
When the computer connects with OpenVPN, I can't print to the printer connected to the local network.
What can I do?
Forum:
Tags:
Hi Juan, can you connect via USB?
The easiest way to do it would be to use a physical USB connection to the printer.
Otherwise, if the remote network and the local network don't overlap then you should be able to add a route to the local network so CUPs can send it's traffic to the printer.
Unfortunately I don't recall the way to add OpenVPN routes OTTOMH but none of this will be TurnKey specific. Any instructions for Debian/Ubuntu should be relelvant - and likely any Linux distro.
If you get stuck post back and I'll try to help as best I can - although please note that I'm pretty snowed under at the moment.
If you do work it out, it'd be great if you could share here so others could benefit.
Solved
The problem accessing local network resources was caused by network overlap. Computers connecting to the remote network via VPN have access to the remote LAN resources, even though I configured this on the VPN server. Since the networks (the remote LAN and the local LAN) had the same range, they overlapped, and computers connecting via OpenVPN could not access local resources such as network printers and file servers.
The solution was to change the network range of one of the LANs And include in the .ovpn file configuration of each client the option to access the local network or a specific IP.
Configuration off .ovpn file of client:
route "192.168.0.210 255.255.255.0" (specific IP)
route "192.168.0.0 255.255.255.0" (access the local network)
Initial configuration with error:
192.168.1.0/24 (local LAN)--------OpenVPN-----------192.168.1.0/24 (remote local LAN)
https://j20003.es/200/img/Printer-OpenVpn.jpg
Corrected and working configuration:
192.168.0.0/24 (local LAN)--------OpenVPN-----------192.168.1.0/24 (remote local LAN)
https://j20003.es/200/img/Printer-OpenVpn-2.jpg
Glad you worked it out.
I'm glad to hear that you worked it out and thanks for posting back with the solution. I'm sure that others will hit this same issue at some point and hopefully they'll find their way to your post! :)
Hi!
This is the explanation of this configuration, which is described in the example configuration file itself:
# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client
Nice one Juan! :)
Nice work and thanks again for posting back. It's fantastic to have this sort of info available to other users. :)
Add new comment