0

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.

  • 1
    You can always manually connect the server to the remote printer using whatever protocols it supports (HP, IPP, whatever). – Michael Hampton Aug 13 '21 at 20:10
  • 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? – manuelnucci Aug 14 '21 at 11:42
  • 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. – Michael Hampton Aug 14 '21 at 11:48
  • 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. – manuelnucci Aug 15 '21 at 11:48
  • Hardcoding? We don't do that anymore. Put it in a configuration or environment file. – Michael Hampton Aug 15 '21 at 11:54
  • 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. – manuelnucci Aug 15 '21 at 14:01
  • So, what I'm really asking is if this sharing mechanism can travel through the VPN somehow and be detected by the app. – manuelnucci Aug 15 '21 at 14:03
  • These service discovery mechanisms only work across a single layer 2 broadcast domain. They are not routable. – Michael Hampton Aug 15 '21 at 18:56
  • @MichaelHampton I've found some approaches that could be helpful to broadcast this packages to the other host. I'll keep digging... – manuelnucci Aug 19 '21 at 00:31

0 Answers0