Airprint in the Enterprise across subnets

本文介绍了一种在企业网络中跨有线和无线子网设置AirPrint的方法。通过配置DNS服务器、CUPS打印服务及iOS设备,使得iOS设备能发现并连接到网络打印机,解决了AirPrint仅限于本地广播域的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

按:这是一个iOS设备在企业网内部打印到网络打印机的方案,由于AirPrint使用Bonjour作为网络资源的搜索,而企业网内部一般不使用Bonjour,Ashish Desai找到了一个方法,使企业用户无论是有线还是无线网络,都可以让iOS使用AirPrint打印。它需要配置DNS,CUPs服务和iOS设备。下面是他的详细配置描述,供大家测试和欣赏。


From:

Airprint in the Enterprise across subnets [Solution]


This is a message to help folks figure out how to setup
Airprint across wired/wireless subnets. Hopefully it will help a few people.

Airprint was designed to work with Bonjour on a local subnet/broadcast domain.
To print in the enterprise where we have wired/wireless infrastructure, 
we need to use a DNS server to find the printer resources

Assumptions:
Our internal domain is: foocompany.com
We create a new subdomain: bonjour.foocompany.com
Creating a new subdomain allows up to apply DNS views so we can show print/bonjour services in
close proximity of the user.

You have a CUPS printer server (linux/apple) running at printserver.bonjour.foocompany.com

1. Setup a DNS server
If you setting up a test domain server, you can setup forwarding to your primary production server.

This way all DNS queries continue to work

In your named.conf file setup forwarding
options {

forwarders { YOURTOPNAMESERVER_IPADDR; YOURTOPNAMESERVER_IPADDR2; };
forward first;
allow-query-cache { any; }; // Allow client queries from other subnet to query from cache
};


Create a new zone, "bonjour.foocompany.com"
zone "bonjour.foocompany.com." { type master; file "/etc/bind/db.home"; };
zone "foocompany.com" { type forward; forward only; forwarders { YOURTOPNAMESERVER_IPADDR; YOURTOPNAMESERVER_IPADDR2; }; };

Create the following entries to support bonjour browsing
#=======DNS====Begin======
lb.dns-sd.udp IN PTR @
b.dns-sd.udp IN PTR @
dr.dns-sd.udp IN PTR @
db.dns-sd.udp IN PTR @
cf.dns-sd.udp IN PTR @

printserver IN A 10.47.203.188

# For every printer queue defined at the printer server you need to create a TXT and SRV entry
# The visual printer name that show up in the iOS listbox will be the part before .ipp.tcp, example "hpv8a", "hpv8acolor"
#
# _ipp and _printer seem to be equivalents, either seem to work on iOS.

# Printer 1
cups._sub._ipp.tcp IN PTR hpv8a.ipp.tcp
universal._sub._ipp.tcp IN PTR hpv8a.ipp.tcp

#Printer 2
cups._sub._ipp.tcp IN PTR hpv8acolor.printer.tcp
universal._sub._ipp.tcp IN PTR hpv8acolor.printer.tcp

hpv8a.ipp.tcp IN SRV 0 0 631 printserver
hpv8acolor.printer.tcp IN SRV 0 0 631 printserver


# The "adminurl" points to the printer queue url on the CUPS server
# The "rp" key points to the queue name as well
hpv8a.ipp.tcp IN TXT ( "txtvers=1" "qtotl=1" "rp=printers/V8A08A246LJ" "adminurl=http://printserver:631/printers/V8A_08A24
6_LJ" "ty=HP Laserjet V8A" "product=(HP LaserJet 4200)" "transparent=t" "copies=t" "duplex=t" "color=f" "pdl=application/octet-stream,
application/pdf,application/postscript,image/jpeg,image/png,image/urf" "URF=W8,SRGB24,CP1,RS600" )

hpv8acolor.printer.tcp IN TXT ( "txtvers=1" "qtotl=1" "rp=printers/V8A08A246_ColorLJ" "adminurl=http://printserver:
631/printers/V8A08A246_ColorLJ" "ty=HP Laserjet V8A Color" "product=(HP color LaserJet 4650)" "transparent=t" "copies=t" "duplex=t" "
color=t" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg ,image/png,image/urf" "printer-type=0x801046" "URF=
W8,SRGB24,CP1,RS600" )

####Printer TEMPLATE
#cups._sub._ipp.tcp IN PTR NAMEX.printer.tcp
#universal._sub._ipp.tcp IN PTR NAMEX.printer.tcp
#NAMEX.ipp.tcp IN SRV 0 0 631 PRINTSERVERDNSNAME
#NAMEX.ipp.tcp IN TXT ( "txtvers=1" "qtotl=1" "rp=printers/QUEUENAME" 
# "adminurl=http://PRINTSERVERDNSNAME:631/printers/QUEUENAME" 
# "ty=Printer name" 
# "product=(Printer PPD model line)" "transparent=t" "copies=t" "duplex=t" "color=f" 
# "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg ,image/png,image/urf" 
# "URF=W8,SRGB24,CP1,RS600" )

#=======DNS====End======

2. Setup CUPS
Add printers to the CUPS server.
Enable access to the printer queue from remote machines, 
GUI: "System->Admin->Printing->Server->Server Setting: Allow printing from the internet"
Also make sure the following lines are present in /etc/cups/cupsd.conf
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
AccessLog syslog
AccessLogLevel all
LogLevel debug
MaxLogSize 0
SystemGroup lpadmin
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols CUPS
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
BrowseProtocols all
DefaultAuthType Basic

3. Change iPAD configs
Add your DNS server as the first DNS server in the network settting page. 
Add "bonjour.foocompany.com" to the DNS domains to search

4. Test printing
Open up Photos application.
Select a picture
Select "Send To->Print"
Select "Printer", now a list of printer names should show up as defined in the DNS server
Select a printer and hit "Print"
Fast task switch to Print Center to verify print job is being sent




Thanks
Ashish Desai
Security Architect
Fidelity Investments
email: ashish.desai@fidelity.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值