Score:0

Detect printer in VPN client

kg flag

The problem is based on a simple restriction:

The server which holds the business logic is not connected with the printer in the same network. The printer is located in another network which does not have the possibility to expose a public IP.

The architecture I've designed so far is this can be seen here.

The two LANS are represented in orange and blue, and there's a VPN in red which connects the two. Due to the blue LAN not being possible to expose a public IP, the only way is to serve the VPN from the server.

With this setup, is it possible that the Node.js app running inside the server detects the printers that CUPS publishes in the blue/red network?

I understand that CUPS advertises the available printers through mDNS, but only on the specific network it is connected to. So, there's the possibility that the packages may not travel from a client VPN to the actual server (due to standard VPN behaviour).

Is it possible what I'm trying to achieve? Which other options do I have?

Update

I've found some approaches that are worth investigating:

  • Use a VXLAN to connect the two nets as one and multicast over the network
  • Enable multicast over OpenVPN or Wireguard
  • Repeat packages sent by mDNS on another interface
  • Create a proxy service record using DNS-SD

Here's some useful information:

I think the answer lies in one or the combination of some of them.

Michael Hampton avatar
cz flag
You can always manually connect the server to the remote printer using whatever protocols it supports (HP, IPP, whatever).
kg flag
Could you give me an example? Is it possible given the fact that the network in which the printer is located does not have a public IP?
Michael Hampton avatar
cz flag
If you can reach the printer on the network, you can set it up. If you can't reach the printer on the network, then nothing you do will make any difference.
kg flag
Yeah, probably I could reach the printer through CUPS in the other network. What I wanted was to install a library in Node.js app that detects printers published through mDNS on the VPN, and have a dynamic behaviour (detect ups and downs) instead of _hardcoding_ the printer's URL (x.x.x.x:631/Epson) in the app. That's my real goal here.
Michael Hampton avatar
cz flag
Hardcoding? We don't do that anymore. Put it in a configuration or environment file.
kg flag
I know. What I meant is that I do not want to know beforehand which printers are on the other network. It could be one, two or any number. My idea was that the app would detect the available printers published by the CUPS server through [this](https://wiki.archlinux.org/title/CUPS/Printer_sharing#DNS-SD_advertisement) or [this](https://wiki.archlinux.org/title/CUPS/Printer_sharing#Sharing_via_Internet_Printing_Protocol) method. Then, instead of having the URL in an environment file I would have a real dynamic service discovery implemented, and only show clients the printers that are available.
kg flag
So, what I'm really asking is if this sharing mechanism can travel through the VPN somehow and be detected by the app.
Michael Hampton avatar
cz flag
These service discovery mechanisms only work across a single layer 2 broadcast domain. They are not routable.
kg flag
@MichaelHampton I've found some approaches that could be helpful to broadcast this packages to the other host. I'll keep digging...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.