Skip navigation

Tag Archives: IPv4

Click here for a tl;dr version that just gives you the fix without the background.

At my school, we have a fairly robust iPad program, and the decision was made, when we began to ramp up the deployment of iPads, that users should be able to print to their iPads.

Like so many of Apple’s technologies, AirPrint is one of those things that works well in a home environment but pretty quickly breaks down when taken into an enterprise environment.  Sure, you could go out and buy all new printers that have AirPrint built in, but when you’ve got a dozen or more printers that you might want to have available for iPad users, that quickly becomes a very expensive proposition.

You can roll your own AirPrint solution using a Linux box running avahi, but most people and departments would rather have a pre-baked solution, and then there’s only really one option: Printopia Pro.  If you’re running any sort of Bonjour gateway, such as the one built in to Cisco’s wireless access point controllers or Aerohive’s HiveManager cloud controller, you don’t even need more than one instance of the software.

And then Apple broke it all.

An engineer at the company that now develops Printopia Pro told me that for iOS 8 and OS X Yosemite, Apple moved away from a widely-used open-source mDNS discovery daemon to their own, in-house-developed daemon, and that’s where all the trouble started.

In a best-case scenario, we could maybe advertise four printers, and we often had to manually restart the Printopia Pro service when even those printers disappeared.

There is a solution that should work for most deployment cases, though.


This solution works only on networks running IPv4 and assumes that your Printopia Pro server is using a static IP address.  No, I don’t know all the technical details behind the IPv4/6 portion of this fix; I could have asked, and would have been very interested to find out the answer, but I didn’t feel like I had time for a several-hour conversation at the time.

Log in to your Printopia server and open the Terminal application and run the following command

networksetup -setv6off Ethernet

networksetup -setv6off EthernetLike the option says, this command turns off IPv6, which can’t be done through the GUI.  Next, open Printopia’s Advanced Settings.

Open Advanced Settings (command + comma)Under the General tab, there is a box to check that says “Publish printers using IPv4 addresses only.”  Uncheck this box if it’s checked.  Yes, that may seem counter-intuitive, but remember that you just turned off IPv6.

Picture of General tab under Advanced Settings with arrow pointing towards bottom-most checkbox with directions to uncheck that option.At this point, it’s worth making sure that printers are being advertised only over the Ethernet interface.  For each printer group, click “Settings…”

Picture indicating location of Settings button for printer groupand, under the Network Interfaces tab, select the bottom radio button and then select only your Ethernet interface.

Network Interface tab opened with only the Ethernet interface, en0, selected.Finally, for good measure, restart the Printopia service from the General tab.  Within a minute of applying these changes, we went from seeing four printers advertised over Printopia to seeing all seven printers that we were sharing.  You can check to make sure that the printers are being advertised over your network using the free Bonjour Browser application.

Bonjour Browser application window showing printers being advertised.So far, this solution has been totally stable for us, though it’s also recommended that you update your instance of Printopia Pro to the most recent release, 1.0.3.2, which can be downloaded here.

Advertisements

If you’ve ever sat in front of a computer giving you one of those dreaded “no network connection” messages, you’ve probably clicked everything that looks like it might bring the Internet back at one point or another, and in your quest for connectivity, you’ve probably run across the term “subnet mask” at least once. If you don’t know a lot about networking, subnet masks might look kind of intimidating. I mean, there’s a lot of numbers and dots going on there.

A typical subnet mask that you’re likely to encounter in a home network should look like 255.255.255.0 unless whoever configured the network did something unusual. If you’ve encountered subnet masks at your office, they might look like 255.255.0.0 instead, but those are just typical subnet masks. Your mileage may vary.

So what the hell is a subnet mask, anyway? To put it simply, a subnet mask tells your network if traffic is going around locally or if it needs to go out onto a wider network.

Let’s break that down a bit more. At its heart, every IP address is a 32-bit binary number. Let’s take an IP address that most people have seen if they’ve ever set up a home wireless router; 192.168.0.1 is 11000000.10101000.00000000.00000001 in binary (though the dots are just there for us silly humans to see so that we can comprehend what we’re seeing). This address has a subnet mask of 255.255.255.0 (which is 11111111.11111111.11111111.00000000 in binary or, as the computer sees it, 11111111111111111111111100000000). Now if you or I were on this network and went looking for the address 192.168.0.42, it’s as plain as day that it’s on the same network and subnet, but a computer has to hold the address up against its assigned subnet mask and does a bit of binary math on it.

If you’re not familiar with the logical/binary AND operator, all you need to know is that it takes two one-bit binary arguments (a 1 or a 0) and compares them. If you pass in two 1s, you get back a 1, otherwise, you get a 0. Therefore, if you AND an address against a subnet mask, you will get back the network ID (in the case of the example I’ve been using, that’s the first three octets–192.168.0) followed by zeroes for the client ID. If the network ID of the address in question matches the address the traffic is coming from, then the system knows the traffic is local, otherwise, it needs to go outside of the local network.

I know what you’re saying right now–this is obvious stuff–why would I need to know about subnet masks? Well, if you’re dealing with simple networks, you mostly don’t. However, if you’re interested in splitting up your network into several subnets or VLANs (Virtual Local Area Networks). Let’s say that we have a network what starts at 192.168.8.0 and we want to split it into several subnets, say to isolate network traffic between an administrative office and a public segment of your network. The base network is 192.168.8 /24 (the /24 indicates the number of bits in the subnet mask). Let’s split that into two networks. To do that, we add 1 bit to the subnet mask, making it /25 and creating two subnets with address ranges of 192.168.8.1 - 192.168.8.127 and 192.168.8.128 - 192.168.8.254 (the 0 and the 255 addresses in the last octet are reserved addresses).

Now if you look at two addresses for traffic on this network, it becomes a bit harder to tell which subnet traffic belongs to. (Of course in this example, it’s still easy to tell, but bear with me; I didn’t want to make more subnets.) Your subnet mask is /25, which is 25 1s and seven 0s totaling 32 bits. AND that subnet mask against your target address and presto! There’s your answer.

Now you know, and knowing is half the battle.