1

lets start step by step.

Devices:

REMOTESERVER = ubuntu server 12.04 (ip 95.211.132.49);

LOCALSERVER = ubuntu server 12.04 (public ip 195.91.166.141);

PRINTER_1 = TSC TTP-343C;

PRINTER_2 = HP LaserJet Pro M201dw;

Description:

LOCALSERVER (private ip 192.168.0.1) work as gateway. Both PRINTERS connected to the network by ethernet cable, so the have private ips (192.168.10.38 and 192.168.10.39). REMOTESERVER - apache + php server.

Objective: I want/need print two files from REMOTESERVER by click one button. First file should print on PRINTER_1, second file on PRINTER_2.

What Im doing: Im install CUPS (https://www.cups.org/) and LPR (http://www.wikiwand.com/en/Line_Printer_Daemon_protocol). After that Im add printers to CUPS. lpstat -p -d show both printers. Next I print two files: 1.png by command:

lpr -P ttp 1.png 

and 2.png by command:

lpr -P hp 2.png 

so its work.

Problem: I cant print files by lpr command from REMOTEHOST. On REMOTESERVER I cant add printers because they have only a private ip. I have no idea how add printers on REMOTESERVER. I also tried add ip of LOCALSERVER and forwards port to one of printers, but it isn't help. I tried use http\ipp\socket and another protocol when I add printers in CUPS. So question is How I can add printer on REMOTESERVER.

Thx very much and sorry for my english.

chelbeh
  • 11
  • 5
  • What does "I cant print" actually mean? – arkascha Dec 17 '15 at 09:33
  • You either have to configure the printers on REMOTESERVER or use `lpr -H ...:...`, comes out the same: in both cases you need network access REMOTESERVER to the printers. You cannot send a file to a network node you have no access to. A port forwarding as described can work, provided you have network access from REMOTESERVER to LOCALSERVER and that LOCALSERVER again has access to the printers. Why this does not work with your current setup is something we cannot say, since we only have the information you provide. Check the CUPS log files and the printer status messages on REMOTESERVER. – arkascha Dec 17 '15 at 10:04
  • shame of me. lpr -H helps) Thx arkascha – chelbeh Dec 17 '15 at 10:15

0 Answers0