Airprint in the Enterprise across subnets

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

按:这是一个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

### RIP协议中重新分配子网的配置方法 在RIP(Routing Information Protocol)中,重新分配子网通常涉及将其他路由协议或静态路由中的子网信息引入到RIP协议中。此过程需要使用`redistribute`命令,并确保适当的度量值被设置以避免路由环路或其他问题[^1]。 以下是重新分配子网到RIP的具体配置示例: ```python router rip version 2 network <subnet-to-be-redistributed> redistribute static metric <metric-value> redistribute ospf <ospf-process-id> metric <metric-value> ``` - `router rip`:启用RIP协议。 - `version 2`:指定使用RIPv2版本,支持子网掩码。 - `network <subnet-to-be-redistributed>`:定义需要通过RIP广播的网络。 - `redistribute static metric <metric-value>`:将静态路由重新分配到RIP,并设置相应的跳数作为度量值。 - `redistribute ospf <ospf-process-id> metric <metric-value>`:将OSPF协议的路由重新分配到RIP,并设置度量值。 需要注意的是,在重新分配过程中,必须确保RIP的度量值(跳数)不超过15,否则会导致路由不可达。此外,为了避免潜在的路由环路问题,可以使用过滤器或策略来控制哪些路由可以被重新分配[^2]。 ### 示例配置 假设有一个路由器R1,其需要将静态路由和OSPF协议中的子网重新分配到RIP中: ```python router rip version 2 network 192.168.1.0 network 192.168.2.0 redistribute static metric 3 redistribute ospf 1 metric 5 ``` 在此配置中: - `network 192.168.1.0` 和 `network 192.168.2.0` 是需要通过RIP广播的网络。 - 静态路由的度量值设置为3。 - OSPF协议(进程ID为1)的路由度量值设置为5。 ### 注意事项 重新分配子网时,应特别注意以下几点: - 确保RIP版本为2,以支持子网掩码的传播。 - 设置合理的度量值,避免超出最大跳数值(15)。 - 使用访问列表或路由映射来过滤不需要的路由,从而减少不必要的网络流量和资源消耗。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值