📜 ⬆️ ⬇️

Print gateway based on CUPS for terminal server based on MS WS 2008 R2 and its clients based on MS Win 2k / XP with printers connected to them

It will be interesting for you to read this report if the picture of the development of your LAN fits the following description



Also, please agree that non-functional issues — for example, security issues — are not addressed here.

The practical need for this solution


Several copies of printers fell under some of the cases discussed in the preamble of the report. For example: one XEROX DocuPrint P8ex (client OS Windows XP) and two copies of HP LaserJet 1005 (one connected to a client computer based on Windows 2000, the other - based on Windows XP).

The route for the print job


  1. Application program on a Windows 2008 R2 server or on a Windows 7 workstation; IPP client
  2. GNU / Linux gateway with CUPS printing system and SAMBA client
  3. Client workstation Win 2k / XP with a locally connected printer, which is accessible from the Microsoft network

')

Gateway idea


I came up with after familiarizing myself with [ 1 ] and searching for alternatives to installing GNU / Linux on client machines; probably, subconsciously, the emergence of such an architecture was influenced by familiarity with the three-tier architecture of access to the database [ 2 ] and the search for ways to use it as such, and its analogies.
The very concept of a gateway does not quite fit into this context, but only by analogy: according to [3, p.313]
"The gateway is a relay system providing the interaction of two information networks."
It would be more accurate to call it a virtual print gateway or something else; further, for brevity, this link of the route will be called simply the gateway.

The most interesting is already stated, it's time to move on to the routine. The following is ...

Concept instructions for the deployment of the gateway


  1. On the client machine with the address 192.168.ab there is a user prn_user with the password secret - for printing through the Microsoft network, the print subsystem is configured and works as it is in the Windows 2000 / XP / 2003 environment. We look at the name of the printer on the network: the context menu of the printer, the item “Properties”, the tab “Access”, the field “Share:” xerox . % computername% of this client: UHost01 - we will need it, for example, to generate a meaningful name in the CUPS system; although if it matches the DNS name inside the local zone, and your household has a good name resolution in IP addresses, and the search is inside the domain suffix of this zone, then it may be used as a substitute for the address 192.168.ab hereinafter.
  2. Customize the print gateway
    1. System-wide work with the CUPS server
      1. The basic part of the gateway. Looks like that
        1. Iron gateway: an old server system unit DELL PowerEdge 1400 2xCPU iP-III-800/1536 MB RAM / 18 GB HDD
        2. OS: Debian GNU / Linux 6.0 i386
        3. Gateway Address: 192.168.ac
      2. Package installation
        If CUPS is not installed yet, give the command to install it.
        # aptitude install cups
        ...
        0 packages updated, 52 new ones installed, 0 packages marked for deletion, and 0 packages not updated.
        You need to get 26.7 MB archives. After unpacking 83.2 MB will be taken.
        Want to continue? [Y / n /?] Y
        ...

        We look, whether CUPS is started
        # /etc/init.d/cups status
        Status of Common Unix Printing System: cupsd is running.

        As required, we go further.
        Also, the system requires the presence of the smbclient package, since The output to the network printer will be on the SMB protocol, and in this package there is a backend for CUPS.
      3. You must make sure that CUPS is configured to accept tasks from outside
        We go to the admin panel, for example, like this: 192.168.ac:631/ 192.168.ac:631/ , click on the tab "Administration", then, in the section "Server" - "Server Settings:" it is necessary to check the "Allow sharing of printers connected to this system" and "Allow printing from the Internet "; if not, then click “Save”, after pressing which we will be asked for the username and password, by default this is the username / password from our Linux system root user account, i.e. as root
    2. We connect the printer to CUPS
      1. Tab "Administration" in the section "Printers", click the button "Add a printer"
      2. In the section "Other network printers:", select the value of the "Windows Printer via SAMBA" radio button and click "Continue"
      3. Section "Add a printer", In the "Connection:" field, enter the value " smb://prn_user:secret@192.168.ab/xerox " (hereinafter: enter the value without quotes) and click "Continue"
      4. Fill in the next field in this way
        Name: drive in " Uhost01_xerox " - this will be the name of the printer in the CUPS system
        The following two fields are not so critical, their meanings should be invented by you for your own convenience:
        Description: " Xerox DocuPrint P8ex "
        Location: " 1 , 13, , .. "
        Connection: " smb://prn_user:secret@192.168.ab/xerox " (already inserted, displayed for reference)
        “Sharing:” - “Allow sharing of this printer” - tick here
        We press the button "Continue"
      5. Choose a printer driver with the same name as ours; if not, then the closest one by name; This approach works in most cases.
        Create: "Xerox" - click "Continue"
        Model: choose "Xerox DocuPrint P8e Foomatic / hpijs-pcl5e (recommended) (black and white, duplex printing)", and at the bottom press the button "Add Printer"
      6. We get to the page “Set default parameters for Uhost01_xerox ” - here there are various parameters of trays and paper size; I left everything as it was and clicked on “Save default settings”
      7. For a few seconds, a window will appear saying that our printer uses the default settings.
      8. We get to the page of the newly added printer and give the command “Maintenance - printing a test page”
    3. If the test page is OK, then the printer is ready to work in CUPS, you can go further
  3. We configure the MS WS 2008 R2 server or the client of Windows 7
    1. Presetting
      1. Turn on the Internet Printing Client
        1. For the case of Windows 7
          Checking: the components should include the Internet Printing client: Start - Control Panel - Programs and Components - in the window that appears, click on the caption on the left “Enable or Disable Windows Components” further on the tree: “Printing and Document Services” - “Internet Client print "- the last jackdaw should stand; if not, then set. Click "OK" to confirm the changes or "Cancel" if the changes are not made.
        2. For the case of MS Windows Server 2008 R2
          This component is disabled by default [ 4 , Tuesday, March 15, 2011 1:49 AM], and I had to tinker to understand why the addition of the printer described in Section 3.2 does not work.
          Start - Control Panel - Programs - Enable or Disable Windows Components
          In the window that appears, select the item “Components” on the left to find the button with the green plus sign “Add components” and in the list put a tick in front of “Client of Internet printing”, click “Next” “Install”.
      2. If the component “Internet printing client” was turned off, and we turned it on, i.e. performed clause 3.1.1., then restart the print server after that, for which the command line:
        > net stop spooler
        > net start spooler

      3. Change the tincture on the proxy server
        All users of this printer should disable proxies in their browser properties, or set an exception, i.e. 192.168.ac or for its subnet as a whole, i.e. for 192.168.a.* .
    2. Printer setup
      This item is also done with administrator rights; Initially, the printer will be available to all users.
      1. Start - devices and printers
      2. Printer installation (wizard window will appear)
      3. For MS Windows Server 2008 R2 there will be an additional step in which we click on “Add a local or network printer as administrator.”
      4. Add a network, wireless or bluetooth printer
      5. Click "the desired printer is not in the list"
      6. The radio button should be in the "Select a shared printer by name" position, next to it is the field where we drive in " 192.168.ac:631/printers/Uhost01_xerox 192.168.ac:631/printers/Uhost01_xerox ", click" Next "
      7. If you successfully contact the printer, the “Add Printer Wizard” will appear, if unsuccessful, an error message will appear. If the line above is opened in the browser, then there is a connection over the network, and we simply forgot to install the Internet Printing Client and / or reload the spooler.
      8. Choose a printer: manufacturer “Generic”, printers “MS Publisher Imagesetter”. OK
      9. "You have successfully installed ...." - it means everything is ok. click "Next"
      10. Click "Print Test Page" to print a test page. "A test page was sent to the printer" - click "Close". "Finish" - to close the wizard
  4. We are happy with users


Sources


  1. avz.org.ua/wp/2011/06/17/printing-to-cups-from-windows
  2. ru.wikipedia.org/wiki/Treason_architecture
  3. Yakubaytis E.A. Information networks and systems. Reference book. - M .: Finance and Statistics, 1996. - 386s .: ill.
  4. social.technet.microsoft.com/Forums/en-US/winserverprint/thread/8e6130df-acba-4a8c-b984-a455667e9e49

Source: https://habr.com/ru/post/166771/


All Articles