Solved How to install cups in Jail and share to LAN?

Hi there,

I have set up jail and enable CUPS in /etc/rc.conf
The following command indicates cupsd is running:

Code:
# sockstat | grep cups
root     cupsd      16347 4   tcp4   127.0.0.1:631         *:*
root     cupsd      16347 6   stream /var/run/cups/cups.sock

I entered the jail and edited the configuration to share cups to whole LAN:

Code:
# vi /usr/local/etc/cups/cupsd.conf
#Listen localhost:631
Port 631

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow 192.168.31.*
</Location>

# Restrict access to the admin pages...
<Location /admin>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow 192.168.31.*
</Location>

Then I enter http://192.168.31.5:631 (the ip of the jail) on another PC but can not open the webpage, even in the jail, fetch http://127.0.0.1:631/index.html shows nothing, also the following command shows no tcp4

Code:
# sockstat | grep cups       
root     cupsd      16347 6   stream /var/run/cups/cups.sock

Once change Port 631 back to Listen localhost:631, the index.html can fetchable in the jail.

What's wrong?
 
Have you tried Listen 192.168.31.5:631 so that it listen on its external interface ?
Without any clue of what type of network you configured for the jail it is not easy to give advice, a general one would be to do the redirect on the host to the jail for port 631 and maybe do a nat rule for it. And then just connect to the host with port 631.
 
Back
Top