 |
01-18-2008
|
#1 (permalink)
| | Linux Guru
Join Date: Jan 2005 Location: Seattle, WA, USA
Posts: 2,409
| Limit Network Printer Access Howdy all. I have an issue with my printer setup that I'd like to have some suggestions are.
I attend a school where they give us only one Ethernet port per student. However, I have two computers. So I am using an Ethernet hub, with my Linux desktop, MacBook Pro, and HP printer plugged into it. In this way, everybody gets Internet access, and both of my machines can see my printer.
The problem now is that because the printer is on the network, anybody can print to it. And for some reason, people like printing 500 pages and using up all of my paper.
Now, the way I see it, there are two possibilities (and I don't know how to do either):
1) Leave the printer plugged into the Ethernet hub and somehow limit access
2) Plug the printer into my Linux box and somehow share it with my laptop
Does anyone know how to accomplish either of these, or some other process?
Many thanks.
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| |
01-18-2008
|
#2 (permalink)
| | Linux Guru
Join Date: Mar 2005 Location: Texas
Posts: 1,699
| Quote: |
Originally Posted by Cabhan So I am using an Ethernet hub, with my Linux desktop, MacBook Pro, and HP printer plugged into it. In this way, everybody gets Internet access, and both of my machines can see my printer. | If I'm understanding you correctly, this arrangement (i.e. hub uplink port to the school ethernet) gives you three University-routable IP addresses.
A quick and easy solution would be to spring for a router/NAT device. This device would then have the only externally facing NIC, with a second, internally facing NIC and a dhcp server so that you're on your own little private LAN.
Another solution would be to plug the printer into the Linux box (usb?) and then install cups on it to share with your Macbook. Installing and configuring cups is pretty trivial on CentOS (depending on your printer). I've never tried on Gentoo, but I figure with their extensive documentation it should be a snap. Once cups is installed you can control access to it at the application level (there are cupsd.conf directives) or even using iptables or tcp wrappers. |
| |
01-18-2008
|
#3 (permalink)
| | Linux Guru
Join Date: Jan 2005 Location: Seattle, WA, USA
Posts: 2,409
| I considered the router solution, but I really don't want to buy one.
However, you were right about the sharing via CUPS. I need to pick up a USB cable, but once I do, I should be able to get that working easily. Gentoo has some documentation on it. I feel a little silly for not checking there first  .
Thanks!
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| |
01-24-2008
|
#4 (permalink)
| | Linux Guru
Join Date: Jan 2005 Location: Seattle, WA, USA
Posts: 2,409
| So it's time for some new snags.
I have changed my setup such that my printer is connected via USB to my Linux box. My laptop is setup, and can view the printer over the Internet (and even getting that far was an extraordinary pain).
The printer works under Linux. On my laptop, I can go to the web interface of my desktop and print a test page. So it would seem to be working.
It is not.
Whenever I try to print from my laptop, I get an error. In my error log, I see lines such as: Code: "POST /printers/Dorm_Printer HTTP/1.1" 200 24071 Print-Job server-error-not-accepting-jobs Now, the printer is definitely accepting jobs. So something must not be setup correctly.
The printer is connecting to:
ipp://MY_IP:631/printers/HP_Deskjet_6980_series_USB_1
and this is certainly the correct queue and IP.
Any ideas? I'm rather stuck at this point.
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| |
01-24-2008
|
#5 (permalink)
| | Linux Enthusiast
Join Date: Nov 2007 Location: MA, USA
Posts: 593
| I know at my college I went to (WPI btw!!) didn't allow the usage of routers, but if you don't want to buy one you could still configure your gentoo box to do routing through iptables |
| |
01-25-2008
|
#6 (permalink)
| | Linux Guru
Join Date: Mar 2005 Location: Texas
Posts: 1,699
| Quote: |
Originally Posted by Cabhan The printer is connecting to:
ipp://MY_IP:631/printers/HP_Deskjet_6980_series_USB_1
and this is certainly the correct queue and IP. | You can print from the cups server (gentoo box), right? e.g. lp some-file
Is that ipp:// URI what you entered into your Macbook?
I have the same setup at home as you (Macbook printing over ipp to a CentOS cups server). Remember to poke holes in the gentoo packet filtering rules for tcp/udp 631. |
| |
01-25-2008
|
#7 (permalink)
| | Linux Guru
Join Date: Jan 2005 Location: Seattle, WA, USA
Posts: 2,409
| Yes. I can print locally from the Linux box. The problem is only with connecting from my MacBook.
And yes, I have my MacBook connecting to that ipp:// URI.
I'm not too experienced with network stuffs, so maybe I'm a bit confused here. I don't even have iptables installed, so I'm not sure how I'm supposed to open up that port (rather, how do I know that it's even blocked? I can connect through HTTP over port 631).
Thanks though. This might actually work!
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| |
01-25-2008
|
#8 (permalink)
| | Linux Guru
Join Date: Mar 2005 Location: Texas
Posts: 1,699
| Quote: |
Originally Posted by Cabhan rather, how do I know that it's even blocked? I can connect through HTTP over port 631 | That's our answer then (I see you mentioned it earlier). This means tcp 631 on your Linux box is open to your Macbook.
FWIW, another quick way to test from your Macbook is: $ nc -z linux.box.ip 631 && echo 'Port is open!'
That will echo the message only if tcp 631 is open to the Macbook.
-------------------------
Anyway, can you change the directive to LogLevel debug in your cupsd.conf? You'll need to restart cupsd afterwards.
Then tail your error_log while trying to print from the Macbook. As you've noticed, cups is complex and sometimes difficult to troubleshoot. Hopefully that will provide some good clues. |
| |
01-28-2008
|
#9 (permalink)
| | Linux Guru
Join Date: Jan 2005 Location: Seattle, WA, USA
Posts: 2,409
| And, naturally, the Linux side was set up perfectly fine. The problem ended up being with the MacBook Pro.
Basically, the Mac OS X System Preferences don't set up printers properly (they use ipp://IP/queue/QUEUE; CUPS uses ipp://IP/printers/QUEUE). I then tried using lpadmin from the commandline, and that seemed to add the printer correctly, but the problem was on the Mac OS X side, with the printer not accepting jobs on the Mac OS X side. When I tried to enable jobs, it patched me through to my Linux box (as it recognized it as a remote printer), but there I got Permission Denied (as I should have).
I finally went through the CUPS admin panel ( cPanelŽ, just like in Linux), and added it from there, and found great success.
Thanks for your help, all!
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT. The time now is 09:20 AM. |
| |