M1 MBA setup - HP printer via Time Capsule

I click “Turn Wi-Fi On” and “Turn Wi-Fi Off” in System Preferences… > Network.

But let me add something.

$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC20: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a8:66:7f:27:86:8f
inet6 fe80::10e4:1b1b:efe9:b40a%en0 prefixlen 64 secured scopeid 0x6
inet 10.0.1.2 netmask 0xffffff00 broadcast 10.0.1.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 0a:66:7f:27:86:8f
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether b6:f6:51:21:91:a3
inet6 fe80::b4f6:51ff:fe21:91a3%awdl0 prefixlen 64 scopeid 0x8
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::345d:d47f:de95:e38c%utun0 prefixlen 64 scopeid 0x9
nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::8587:493c:5190:7ca2%utun1 prefixlen 64 scopeid 0xa
nd6 options=201<PERFORMNUD,DAD>
en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>
ether 00:1c:c2:3e:d6:0b
inet6 fe80::883:1299:c867:a206%en7 prefixlen 64 secured scopeid 0x5
inet 10.0.1.2 netmask 0xffffff00 broadcast 10.0.1.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (1000baseT <full-duplex,flow-control>)
status: active

I don’t understand these things, but I think the above transcript might say or at least hint that my ethernet network is en7 and my Wi-Fi network is en0. I assure you that en7 says RUNNING whether Wi-Fi is on or off. (For what it’s worth, the printer is connected to the Time Capsule via ethernet, but I see no indication of that in the above transcript.)

Well, actually, I might have two routers, the Time Capsule and the AirPort Express that provides Wi-Fi.

Again, I don’t understand these things, but let me emphasize again that the Time Capsule, which connects to the Macs via ethernet, never has internet access. Did this by chance clarify anything?

Continuing to shoot in the dark, I’ll note that my Service Order in System Preferences… > Network lists Wi-Fi above ethernet. The top item in my list of network services is Wi-Fi when it is active and ethernet when Wi-Fi is not active.

For what it’s worth, you might try making Ethernet primary in the service order. On my desktop computer, I have Ethernet as the primary. So both show as connected when the Ethernet cable is connected and Wifi is running, with Ethernet at the top. I can tell via Speedtest that Ethernet is the active link in that situation. I don’t think you’ll see any problems doing this, and it may fix the issue.

I’m not 100% sure what you are trying to accomplish by keeping the time capsule on a different network, but, as far as the Mac is concerned, they are the same network, since you have them both on the 10.0.1 network. So, when WiFi is connected and has an address in the 10.0.1 network, the network rightly believes that the WiFi adapter on 10.0.1.x can reach a printer on 10.0.1.7 - which it can’t, since you say that the Time Capsule is not connected to your other router.

The solution (I think, if I am following all of this) is to set the address of your time capsule to another network - 10.0.2.1 netmask 265.255.255.0 [edit for typo - should be 255.255.255.0 ] will work. I believe then that the Mac will see the 10.0.2 network on Ethernet and the 10.0.1 on WiFi when you turn it on.

So you’re only enabling/disabling Internet access on the one computer, not for the network itself (which would require changing configuration of the Time Capsule?) I’m not sure what this is attempting to accomplish

If your computer has an Ethernet connection, you should probably use it exclusively (disable all other interfaces) or at least make it primary over Wi-Fi (see the reply by @aforkosh).

Your various “en” devices (e.g. en0 or en7) are Ethernet-like devices. This is not just Ethernet, but anything software can treat like Ethernet, including Wi-Fi, Bluetooth and Thunderbolt. There are two ways to determine what they really are. The simplest way is the networksetup -listallhardwareports command. it lists all your built-in network devices, but doesn’t count all of them. For instance, on my computer (a 2018 Mac mini running Catalina), I see:

$ networksetup -listallhardwareports

Hardware Port: Ethernet
Device: en0
Ethernet Address: ...

Hardware Port: Wi-Fi
Device: en1
Ethernet Address: ...
...
VLAN Configurations
===================

The other way, which is more detailed and includes temporarily-connected devices is defaults read /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist

$ defaults read /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
{
    Interfaces =     (
                {
            Active = 1;
            "BSD Name" = en0;
            IOBuiltin = 1;
            IOInterfaceNamePrefix = en;
            IOInterfaceType = 6;
            IOInterfaceUnit = 0;
            IOMACAddress = {length = 6, bytes = 0x...};
            IOPathMatch = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP02@1C,1/IOPP/GIGE@0/BCM5701Enet/en0";
            SCNetworkInterfaceInfo =             {
                UserDefinedName = Ethernet;
            };
            SCNetworkInterfaceType = Ethernet;
        },
                {
            Active = 1;
            "BSD Name" = en1;
            ...
            SCNetworkInterfaceInfo =             {
                UserDefinedName = "Wi-Fi";
            };
            SCNetworkInterfaceType = IEEE80211;
        },
                {
            Active = 1;
            "BSD Name" = en2;
            SCNetworkInterfaceInfo =             {
                UserDefinedName = "Thunderbolt 1";
            };
            SCNetworkInterfaceType = Ethernet;
        },
        ...
                {
            Active = 1;
            "BSD Name" = en7;
            SCNetworkInterfaceInfo =             {
                UserDefinedName = iPhone;
                ...
            };
            SCNetworkInterfaceType = Ethernet;
        },
        ...

As you can see in the excerpt from my computer:

  • en0 is the hardware Ethernet port (named “Ethernet”)
  • en1 is Wi-Fi
  • en2 is Ethernet-like networking on the first Thunderbolt port
  • en7 is networking via my iPhone (when it is connected).

Also present on my computer (which I didn’t bother to paste into the above excerpt) are:

  • en3, en4 and en5 are the other three Thunderbolt ports
  • en6 is Bluetooth PAN (personal-area network)
  • en8 is an iPad
  • en10 is “iBridge” which I think is for communication with the T2 chip
  • fw0 is FireWire networking (via my Thunderbolt-FW adapter)

Getting back to your ifconfig output, we find (thanks to lots of web searching…):

  • lo0 is the “loopback” device. Packets sent to it always “loop back” to itself and never leave the computer.
  • gif0 is a generic tunneling device for tunning IPv6 over IPv4 and vice versa
  • stf0 is a 6-to-4 device designed to help transition networks between IPv4 and IPv6
  • en0 is an Ethernet-like device (see above). So far I’ve been assuming it’s your hardware Ethernet ports, but you should double-check. If it’s your Wi-Fi interface, that would explain why disabling Wi-Fi disables it.
  • p2p0 is a “point to point” interface. I think it’s used in conjunction with AWDL (see next bullet)
  • awdl0 is Apple Wireless Direct Link, used for creating temporary Wi-Fi networks (e.g. for AirDrop)
  • utun0 and utun1 are network tunneling interfaces used to support the “Back to my Mac” remote access feature.
  • en7 is another Ethernet-like interface. See above to identify it.

Regarding your printer, you won’t see it on this list. These are your Mac’s network interfaces.

It is not possible to reliably enumerate all devices connected to a network interface (whether Ethernet, Wi-Fi or anything else). But you can use the dns-sd command to manually make Bonjour service discovery requests and look at the results. For example (type Ctrl-C after each command after seeing output - the command will otherwise keep waiting for additional responses to its requests):

  • Browse for service instances:

    $ dns-sd -B
    Browsing for _http._tcp
    DATE: ---Sat 06 Mar 2021---
    16:17:37.511  ...STARTING...
    Timestamp     A/R  Flags  if Domain  Service Type  Instance Name
    16:17:37.511  Add      3   4 local.  _http._tcp.   linksys1...
    16:17:37.511  Add      3   4 local.  _http._tcp.   myrouter
    16:17:37.511  Add      2   4 local.  _http._tcp.   Brother HL-L3270CDW series
    ^C
    

    In this case, there are three Bonjour services on my network. linksys1... and myrouter are two routers. Brother HL-L3270CDW series is my printer.

  • Lookup connection information from the service name, type and domain:

    $ dns-sd -L 'Brother HL-L3270CDW series' _http._tcp. local.
    Lookup Brother HL-L3270CDW series._http._tcp..local.
    DATE: ---Sat 06 Mar 2021---
    16:22:06.877  ...STARTING...
    16:22:07.077  Brother\032HL-L3270CDW\032series._http._tcp.local. can be reached at HL3270.local.:80 (interface 4)
    ^C
    

    In this case, it’s showing the web interface to my printer can be reached via multicast DNS (part of Bonjour) at hl3270.local

  • Explicitly look up IPv4 and/or IPv6 address information about a hostname (via normal or multicast DNS):

    $ dns-sd -G v4v6 hl3270.local
    DATE: ---Sat 06 Mar 2021---
    16:27:45.258  ...STARTING...
    Timestamp     A/R  Flags if Hostname       Address                                      TTL
    16:27:45.432  Add      3  4 HL3270.local.  192.168.1.14                                 120
    16:27:45.432  Add      2  4 HL3270.local.  FE80:0000:0000:0000:3E2A:F4FF:FE74:6452%en0  120
    ^C
    

    Which shows the printer’s IPv4 address (192.168.1.14) and its IPv6 address (a link-local address reachable via the en0 interface).

1 Like

I should have caught that. Thank you.

Done, and it works like a charm (so far; I hope I haven’t jinxed it).

Thank you again, @Shamino, for your active engagement in this thread. It will take me some time to go through your last post and enter those commands in Terminal. As I said above, everything seems to work now. But I am curious. Why did you suggest connecting the printer via ethernet rather than USB?

Mostly to eliminate the Time Capsule as a possible source of a problem.

Using USB, the Time Capsule needs to establish itself as a print server. Data goes to Time Capsule, which needs to buffer the data and then relay that data to the printer. It also needs to deal with temporarily storing entire documents if multiple computers are trying to print at the same time.

While there’s nothing technically wrong with this, it’s another device in the chain, which can be a source of problems if there’s a bug or a failure.

If the printer is Ethernet connected, then there’s no middleman. Each computer sends data directly to the printer. (The JetDirect/LPR protocols are used to make sure they don’t step on each other). In this situation, the Time Capsule acts as a simple Ethernet switch, which is easily replaceable, should it be necessary.

There’s also a potential performance advantage. Gigabit Ethernet (at 1000 Mbit/s) is faster than USB 2.0 (top speed of 480 Mbit/s). If the printer can process data faster than USB’s speeds, Ethernet will let your computer finish printing faster. And, of course, by not having the Time Capsule’s print server in the middle, any overhead imposed by it goes away.

Time Capsule’s ability to act as a USB print server is great because it lets you network printers that don’t have their own built-in networking interfaces, but I think, in the absence of other problems, using a printer’s own network interface is generally going to work better.

Thanks for that explanation, @Shamino. For my routine purposes, the buffer and the speed are not a concern. (Most days, the printer does nothing, and when someone does print to it, it’s almost always a short document.) But for troubleshooting, you’re absolutely right that removing a step is worthwhile. Anyway, now it’s set up for ethernet printing, and I thank you and, @Simon, and @ddmiller for the help.

Is there a way to see what protocol (JetDirect, LPR, etc) I chose when I added the printer? Is there a way to change it short of deleting the printer and adding with the desired protocol?

Another benefit of the ethernet connection is that I can run HP Utility. I could not do that with the USB connection to the Time Capsule. I also found the printer’s web page, which I believe was unavailable with the USB connection to the Time Capsule, although I’m less sure of that. In any event, I have some exploring to do. Thanks again for all the help.

Unfortunately, Apple doesn’t provide any convenient GUI method for viewing this, even though they provide a GUI interface for creating printers.

But because macOS uses CUPS for printing (an extremely popular package used by most Unix systems these days), there are two two non-Apple methods you can use: looking at the configuration file directly or using a web-based interface to CUPS.

The configuration file

The location and format of the CUPS configuration file is implementation-dependent, but you can type cups-config --serverroot to see where the configuration files are stored:

$ cups-config --serverroot
/private/etc/cups

In that location, you can look at the file printers.conf to see the configuration. You need special permission to view this file, so you’ll need to view it from an account with administrator access using the sudo command.

The file contains a lot of information, but the important lines in there are:

  • Info. The name of the printer device (should match the name in the system preference panel)
  • MakeModel. The name of the device driver used for the printer
  • DeviceURI. A URI that specifies how to connect to the printer, including its protocol, address and other related information.

I ran a quick test on my system, creating three printer devices that reference my printer via IPP, JetDirect and LPR. Here’s the interesting parts of my configuration file:

$ sudo cat /etc/cups/printers.conf
Password:
# Printer configuration file for CUPS v2.3.1
# Written by cupsd on 2021-03-08 10:27
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
NextPrinterId 3
<Printer HL_L3270CDW>
...
Info HL-L3270CDW
...
MakeModel Brother HL-L3270CDW series CUPS
DeviceURI ipp://printer/ipp/print
...
</Printer>
<Printer JetDirect_printer>
...
Info JetDirect printer
...
MakeModel Brother HL-L3270CDW series CUPS
DeviceURI socket://printer/
...
</Printer>
<Printer LPD_Printer>
...
Info LPD Printer
...
MakeModel Brother HL-L3270CDW series CUPS
DeviceURI lpd://printer/
...
</Printer>

In the above examples, my printer’s network hostname is printer. (I am running a DNS server which maps that name onto it’s IP address). The three URIs are:

  • IPP
    • URI: ipp://printer/ipp/print
    • The above URI breaks down into:
      • ipp:. Identifies this URI as the IPP protocol
      • //printer/. The printer’s host name. It could also be a Bonjour name or an IP address, depending on how you configured your printer. Since no port is specified, the default IPP port (631) is used.
      • ipp/print. Identifies the path to the print queue within the hostname and port. You can safely ignore this. The one here is what Apple automatically provided (I think by probing the printer for its configuration).
  • JetDirect
    • URI: socket://printer/
    • The above breaks down into
      • socket:. Identifies this URI as a raw TCP socket, which is what JetDirect interfaces use
      • //printer/. The printer’s host name. Since no port is specified, the default JetDirect port (9100) is used.
  • LPR
    • URI: lpd://printer/
    • The above breaks down into
      • lpd:. Identifies this URI as LPR protocol (“lpd” stands for “Line Printer Daemon”, the name of the printer-management software originally used to implement this protocol on Unix systems).
      • //printer/. The printer’s host name. Since no port is specified, the default LPR/LPD port (515) is used.
      • Any subsequent terms in the URI specify a print queue. This is typically for print servers that host multiple printers but can usually be ignored for the LPR server built-in to a printer.

The web interface

CUPS includes a web-based user interface, which is easier to use than directly accessing configuration files. Before you use it, you will probably need to enable the web interface using the cupsctl command:

$ sudo cupsctl WebInterface=yes
Password:

No output is generated by this command, but it enables the web interface, which you can access at https://localhost:631/. Since the CUPS server uses a self-signed security certificate, you may have to click a few buttons to tell your web browser that it is not malware and you really want to visit the page.

Here’s the CUPS home page:

From there, you can click on Printers (at the top of the page) to view all of your printers:

If you then click on one of the printer (queue) names, you can see information about it, including its URI (connection):

1 Like

Thanks, @Shamino, for your patient and thorough explanations.