Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! thewonka's Avatar
    Join Date
    Jan 2006

    Cool How to make CUPS a JetDirect/AppSocket print server

    I have been told that you can setup cups to listen to port 9100 like a working AppSocket (raw) printer.

    I have been looking for some way to do this for days now and no luck... i have found 3rd party tools but none have worked for me ( ppf - Printer Port Forwarder for example )

    i wish the printer connected to my routers usb port to print via port 9100 or some other using CUPS.

    if there is a way to configure my linux router (with cups) to share its printer via por 9100 to other computers.

    The client config i can do easy, but the server config is something that i am not sure can be done with just cups.

    for example my routers ip address ( the router that has the printer plugged in to its usb port (/dev/usb/lp0) is

    My client machine is, and i wish to use the printer on via por 9100 as i would any jetdirect print server.

    I was told i can configure cups to do so but i have not found any way to do it if its true.

    Is there really a way to do this? or is this just a myth?

    Hope somebody knows,

  2. #2
    Just Joined! thewonka's Avatar
    Join Date
    Jan 2006


    Figured it out! anybody interested in knowing how, pm me.

    Since theres no info on it out there.. i guess its a secret or something...

  3. #3
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    Dont do this by PM - post it on the thread, it expands everyones knowledge. I had taken a passing interest in this, btw, as it was something that appealed to me technically (my printer is in the loft at the moment, but comes out when we move house, hopefully soon...).
    Linux user #126863 - see

  4. $spacer_open
  5. #4
    Assuming CUPS is setup and running...

    Make sure /etc/services has the following line:
    jetdirect 9100/tcp laserjet hplj #

    If you are using xinetd,
    create the file /etc/xinetd.d/jetdirect with the following contents:

    # Allow applications using the AppSocket / JetDirect protocol
    # to communicate with CUPS.
    service jetdirect
    socket_type = stream
    protocol = tcp
    wait = no
    user = lp
    server = /usr/bin/lp
    server_args = -d <CUPS_PRINTER_NAME> -o raw
    groups = yes
    disable = no

    Restart your services:
    service xinetd restart
    service cups restart

    If you are using inetd instead of xinetd,
    edit the file /etc/inetd.conf so it contains the following line:

    9100 stream tcp nowait lp /usr/bin/lp lp -d <CUPS_PRINTER_NAME> -o raw

    Restart your services:
    service inetd restart
    service cups restart

    Your CUPS_PRINTER_NAME can be found in the /etc/cups/printers.conf or /etc/printcap files.


  6. #5
    Quote Originally Posted by thewonka View Post
    Figured it out! anybody interested in knowing how, pm me.

    Since theres no info on it out there.. i guess its a secret or something...

    Regarding you're original question... you said you figured it out?? So you're miles ahead of me... I'm a linux novice to put it mildly.

    However, I'm searching for some software means of capturing output from a host application that is destined for a HP JETDIRECT attached printer... background of situation: I'd like to take the output from legacy application (unkown host with no current support) and redirect the raw output to a file on a linux box that can subsequently hand it off FTP/LPR/WHATEVER to some other host/application.

    I have physical access to the JETDIRECT BOX and the two printers that are attached (one is an HP laserjet and one is an epson line printer).


    legacy host application with no ability to change LPR/PORT/IP/ETC port printing settings

    --------------------------------------------\--- EPSON LinePrinter (parallel)


    no change to legacy host application

    LEGACY HOST APP ----> LINUX HOST w/ JETDIRECT emulation PORT 9100 capture ---> redirect to file

    Can CUPS be used to do this? Is CUPS the best tool to do this or are there other progs that are better suited to emulate Jetdirect box/printer. Essentially, because we have no control over the host application we have to fake the host into thinking that it is still talking to the current JETDIRECT Box/printers.

    Any thoughts or comments greatly appreciated...


  7. #6

    thanks for the tips. going to try this right away , BUT . .

    in the services file i have an entry on line 9,548:
    hp-pdl-datastr, 9100/udp pdl-datastream

    in order to add the line:
    jetdirect 9100/tcp laserjet hplj #

    should the original line be commented out ?

  8. #7
    I followed the advice from JC, it should work , seems straight forward, but not happening for me yet.

    "nmap -sT localhost" does not show port 9100 as listening

    Tried a "tcpdump port 9100" while sending a print from the remote computer, and get a bunch of information that seems to be irrelevant to port 9100. I could use a bit of help understanding it.

    I must not understand tcpdump, because even though i specified port 9100, i'm getting information that seems to be not for port 9100 at all, but it does all come from the correct computer that i sent my prints from.

    15:32:39.581853 IP > R 0:0(0) ack 1882637340 win 0
    15:32:39.734768 IP > S 1927031485:1927031485(0) win 24820 <mss 1460>
    15:32:39.734775 IP > R 0:0(0) ack 1927031486 win 0
    15:32:49.895042 IP > S 3496895047:3496895047(0) win 24820 <mss 1460>
    15:32:49.895082 IP > R 0:0(0) ack 3496895048 win 0
    15:33:00.056810 IP > S 190154027:190154027(0) win 24820 <mss 1460>
    15:33:00.056837 IP > R 0:0(0) ack 190154028 win 0
    15:33:10.218491 IP > S 2915493815:2915493815(0) win 24820 <mss 1460>
    15:33:10.218517 IP > R 0:0(0) ack 2915493816 win 0
    15:33:20.380207 IP > S 1604338383:1604338383(0) win 24820 <mss 1460>
    15:33:20.380232 IP > R 0:0(0) ack 1604338384 win 0

  9. #8
    my mistake

    looking at the info after i posted it, "tdirect" was obviously the local service, so rechecked my "services file and had mispelled jetdirect

    Fixed the typo, restarted xinetd and cups, and voila, working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts