External SSH tunnel fails with cellular modem

Failure to run an SSH tunnel through a cellular broadband modem


For years I keep connected to home computer, while travelling, using protocols I have documented at https://ctlow.ca/SSH-VPN_MacOSX.html. Ups and downs but have essentially kept it running.


Until now. For various reasons, I have switched from a cable-modem to a cellular-modem, and as far as I can tell, the ISP has it locked down pretty tight. It is not only closed but invisible to the ShieldsUp! service at grc.com.


(But the cellular modem doesn't allow port-reassignment.)


After reconfiguring SSH private/public keys from scratch, I got it to run from within my home network, but it simply times out if I try it from somewhere outside it.


On the server ("host", "remote"), I have turned on Remote Login, including "Allow full disk access for all users", just to get this far.


Should I look at my firewall? I had it working before this new modem.


I have a dynamic DNS service which has always worked seamlessly.


I'm using a very basic Terminal command, from the client, like:

ssh server.account@ddns_account.dynamic_name_server.com


And as I said, that will run from within the home network only.


Am I missing anything obvious?


Thanks to all.

Posted on Jan 6, 2026 6:57 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 7, 2026 2:37 PM

ctlow wrote:

Thanks, MrHoffman,

Your assumptions are correct. I looked at the MacOS firewall, …


The built-in macOS firewall can be left at its default.

My ISP is a major cellphone-network company with a poor history of customer service, which doesn't seem to have affected its profitability, so I can try that, but I don't think I will get very far.

Major companies can serve different customers including themselves, and sometimes less so their subscribers.

They recently provided me with this brand-spanking-new cellular broadband modem, not by Ubiquiti, for a price I couldn't turn down, SSH functionality or not, so my only options I think are to return it and go back to my (expensive) cable-modem service, or live with it.


I usually use the ISP device in its bridged mode or replace it entirely where permissible and feasible, and then install gear appropriate to the tasks. ISP gear focuses on basic functions and low cost of support. Pretty much everything g else is a distant third, at best.


Interestingly, to me, the modem configuration website does list "port forwarding", but it is poorly described in the documentation, and they list in their help files that it is not possible with this model. The port-forwarding page looks like this:

Here is a generic description ofhttps://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.


WAN port is the port facing the internet, and LAN port is the port in the internal net the traffic will get forwarded to, and the internal client is which internal host is involved. Between those two sides of the boxis usually NAT, network address translation. Because of some design fallout, NAT usually blocks all incoming IPv4 traffic. What happens with IPv6 varies. It may pass through, or it may be blocked.


Here is what the Ubiquiti port-forwarding equivalent looks like:


This is very similar ro what you are looking at, though the grouping allows the rule to operate with groups or whatever local ports or whatever local hosts together, rather than dealing with one port or one host at a time.

I don't know what most of that means. I know what a WAN and a LAN are, but not what to do with them here. Probably irrelevant to my question.

You will need a port-forwarding WAN-side rule for TCP port 22 (or another port, if you want to use a non-default port) to the internal LAN-side TCP port 22 on whichever computer is offering the ssh server on the internal network.


Here are the ports used by Apple software: TCP and UDP ports used by Apple software products - Apple Support


Here are the reserved ports, and you will usually want to recognise or (depending on what you are doing) avoid using these, if you are (for instance) picking your own WAN-side port to forward to some LAN-side host and TCP 22 LAN-side: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.


TCP port 8022 is not assigned, so you can conceivably “borrow” that for your external port, and set your ssh command to use (for instance) ssh -p 8022 which will then get port-forwarded to TCP 22 on whichever internal computer, once the port-forwarding rule is established. Or you can forward TCP 22 to TCP 22, but every gremlin on the internet will poke at that port. And poke lots. I usually use a VPN server and not ssh here, not the least of which is because that can forward some or all of the client app traffic using built-in tools. And I usually have firewalls with embedded VPN server capabilities.


I have more to learn about traceroute, but this command (names changed):

traceroute server.account@ddns_account.dynamic_dns_server.com

It’s usually traceroute to just the host name, without an account.


When you are making up a domain name, the domains example.org, example,com, and example.net are available, and are reserved for this and related uses.

ran for many minutes.

The first line reads (names changed):

www.company-wifi.com (192.168.x.y)  3.359 ms  2.765 ms  2.746 ms

It got up to 64 lines of:

* * *


It’s not gettig anywhere, though I;d usually use traceroute yourfirewall.example.com as the parameter, using whatever host name is temporarily yours thanks to DDNS.

and then went back to the command-line.

I don't know of any firewall-embedded VPN server. I didn't see anything like that when I looked at the MacOS one in System Settings.

To determine what features this ISP-provided box supports, you’d have to check the documentation for your ISP-provided firewall / gateway / router / NAT box.


A VPN server in the firewall is usually the best spot, as it deals with NAT, one of the scourges of IPv4.


Once the VPN is connected, your client would be effectively be another host on the same target internal network.


If the firewall lacks VPN server capabilities, it’s possible to run a VPN server on an internal host and set up port forwarding to access that, but that’s more effort and can meet some issues. Particularly around NAT, a scourge of IPv4.

17 replies
Question marked as Top-ranking reply

Jan 7, 2026 2:37 PM in response to ctlow

ctlow wrote:

Thanks, MrHoffman,

Your assumptions are correct. I looked at the MacOS firewall, …


The built-in macOS firewall can be left at its default.

My ISP is a major cellphone-network company with a poor history of customer service, which doesn't seem to have affected its profitability, so I can try that, but I don't think I will get very far.

Major companies can serve different customers including themselves, and sometimes less so their subscribers.

They recently provided me with this brand-spanking-new cellular broadband modem, not by Ubiquiti, for a price I couldn't turn down, SSH functionality or not, so my only options I think are to return it and go back to my (expensive) cable-modem service, or live with it.


I usually use the ISP device in its bridged mode or replace it entirely where permissible and feasible, and then install gear appropriate to the tasks. ISP gear focuses on basic functions and low cost of support. Pretty much everything g else is a distant third, at best.


Interestingly, to me, the modem configuration website does list "port forwarding", but it is poorly described in the documentation, and they list in their help files that it is not possible with this model. The port-forwarding page looks like this:

Here is a generic description ofhttps://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.


WAN port is the port facing the internet, and LAN port is the port in the internal net the traffic will get forwarded to, and the internal client is which internal host is involved. Between those two sides of the boxis usually NAT, network address translation. Because of some design fallout, NAT usually blocks all incoming IPv4 traffic. What happens with IPv6 varies. It may pass through, or it may be blocked.


Here is what the Ubiquiti port-forwarding equivalent looks like:


This is very similar ro what you are looking at, though the grouping allows the rule to operate with groups or whatever local ports or whatever local hosts together, rather than dealing with one port or one host at a time.

I don't know what most of that means. I know what a WAN and a LAN are, but not what to do with them here. Probably irrelevant to my question.

You will need a port-forwarding WAN-side rule for TCP port 22 (or another port, if you want to use a non-default port) to the internal LAN-side TCP port 22 on whichever computer is offering the ssh server on the internal network.


Here are the ports used by Apple software: TCP and UDP ports used by Apple software products - Apple Support


Here are the reserved ports, and you will usually want to recognise or (depending on what you are doing) avoid using these, if you are (for instance) picking your own WAN-side port to forward to some LAN-side host and TCP 22 LAN-side: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.


TCP port 8022 is not assigned, so you can conceivably “borrow” that for your external port, and set your ssh command to use (for instance) ssh -p 8022 which will then get port-forwarded to TCP 22 on whichever internal computer, once the port-forwarding rule is established. Or you can forward TCP 22 to TCP 22, but every gremlin on the internet will poke at that port. And poke lots. I usually use a VPN server and not ssh here, not the least of which is because that can forward some or all of the client app traffic using built-in tools. And I usually have firewalls with embedded VPN server capabilities.


I have more to learn about traceroute, but this command (names changed):

traceroute server.account@ddns_account.dynamic_dns_server.com

It’s usually traceroute to just the host name, without an account.


When you are making up a domain name, the domains example.org, example,com, and example.net are available, and are reserved for this and related uses.

ran for many minutes.

The first line reads (names changed):

www.company-wifi.com (192.168.x.y)  3.359 ms  2.765 ms  2.746 ms

It got up to 64 lines of:

* * *


It’s not gettig anywhere, though I;d usually use traceroute yourfirewall.example.com as the parameter, using whatever host name is temporarily yours thanks to DDNS.

and then went back to the command-line.

I don't know of any firewall-embedded VPN server. I didn't see anything like that when I looked at the MacOS one in System Settings.

To determine what features this ISP-provided box supports, you’d have to check the documentation for your ISP-provided firewall / gateway / router / NAT box.


A VPN server in the firewall is usually the best spot, as it deals with NAT, one of the scourges of IPv4.


Once the VPN is connected, your client would be effectively be another host on the same target internal network.


If the firewall lacks VPN server capabilities, it’s possible to run a VPN server on an internal host and set up port forwarding to access that, but that’s more effort and can meet some issues. Particularly around NAT, a scourge of IPv4.

Jan 7, 2026 9:48 AM in response to ctlow

Does a simple ssh work? Ignore the tunnel for a moment.


Generally to ssh into a Mac from the Internet, you have to setup the primary router to port forward a Mac port to be visible on the Internet side of the router. Is the new service providing the router?


Do you have more than 1 home router? Maybe your original, and a new one from your cellar Internet provider? That can cause connection issues.


Networking is so much fun 😀


I know you have been using ssh tunneling for 15 years, but maybe consider switching to TailScale.com


TailScale will allow your remote Mac, iPhone, iPad appear as if they are on your local LAN.

Jan 6, 2026 8:15 PM in response to ctlow

I will assume absolutely no ”coffee shop” VPN apps, no add-on security apps, no add-on firewall apps, no network-monitoring apps, or similar, are installed here.


The traceroute command would be a typical check, though ISP ssh blocks would not surprise.


As an alternative to using ssh, can you establish a VPN connection into a VPN server embedded in your firewall? (This might involve upgrading the firewall to one with an embedded VPN server.)


As for port blocks at your ISP, talk with the ISP. ISPs tend to get cranky about efforts to work around blocks they have established, too. If the ISP is blocking ssh, they may provide a workaround, may open the port, or may tell you they don’t support it or don’t permit it.


If you use Ubiquiti networking gear, as an alternative look at using their recently-announced travel router.

Jan 7, 2026 4:27 PM in response to ctlow

If your cellular ISP allows port forwarding you would configure it as:


WAN port: high numbered value below 65535. For example 55522, or 54322, or 12322, or 12345 (the trailing 22 is just a hint to me that it is for ssh)


LAN Port: 22


Internet Client: do not know what they want, but I would leave it blank, unless they had a value for ssh, otherwise ignore.


Protocol: TCP, unless the drop-down menu has ssh


WAN connection list: I would ignore, or if it has a None entry or similar, choose that.


Now your remote Mac's ssh command would be


ssh -p 55522 -L your.tunnel.info your.home.routes.IP.address


From home you can use something like Google "What is my IP address", or you have a dynamic DNS service such as no-ip.com or if you own a Synology NAS, they offer a dynamic DNS service for their Synology NAS, and the Synology NAS will keep the dynamic DNS name up-to-date. Having a dynamic DNS name makes life easier.


HOWEVER, BEFORE you switch back to your previous ISP, I strongly suggest you investigate TailScale.com. It can really make accessing your home systems while away much easier. And you are NOT limited to just ssh. Screen Sharing, network attached storage, plex, music, etc...


And TailScale DOES NOT require any IPS setup tricks. It is transparent to your ISP.

Jan 7, 2026 1:11 PM in response to ctlow

Why is it here possible TCP 22 is getting blocked by the ISP? ssh / sftp / scp gets blocked because of attacks, and accessible ssh ports get hammered.


Again, ask the ISP about their policies.


Also have a look at other options and other tunnels.


Some folks move the ssh server and ssh port elsewhere, as another option. Less traffic, but can still get poked.


And yes, do use traceroute for connection testing too, to find where things are falling apart.


Ooooooh, and multiple routers? That’s always a fun way to learn about subnetting.

Jan 9, 2026 6:55 AM in response to ctlow

ctlow wrote:
….
Will this end up all coming down to using Bridge mode? I could ask many more questions, but is this the crux?

Bridge Mode means the gear acts like a “transparent” to networking traffic hunk of patch cable wiring, or like an (unmanaged) network switch box.


Router mode means the device contains a router, needs an IP address, may or may not NAT, will usually not pass multicast IP traffic, will usually not pass private IP address block traffic, and is otherwise decidedly less than transparent. Bridging and Routing modes are important for settings gateway boxes, and also for using access points and mesh networks.

…but says that Bridge mode may be slow…

Bridged mode should not be appreciably different than and may be faster than routing, but details can vary. Performance between bridging and routing is seldom if ever an issue for the same box.* What you’ve put behind the bridged-mode device may alter the speed; your router / gateway / NAT box.

Would I specify Bridge mode for Ethernet or for Cellular? (I can do either or both.)

I would again encourage checking with the ISP before proceeding. See if they block any ports.


By default, ~all IPv4 gateway / router / NAT boxes will block all incoming traffic, and will only allow incoming traffic secondary to outgoing traffic. Port forwarding is one way to customize this default.

The new (cellular broadband) modem-router has 3 ethernet connections, a blue one labelled "WAN/LAN" and 2 yellow ones labelled "LAN", whereas ...

One WAN connection outside for upstream ISP connection, and a switch with three inside LAN connections.

... the LinkSys Wi-Fi router has 4 blue "ethernet" connections and one yellow ethernet connection labelled "Internet".

One WAN, four LAN.


Higher-end gateway / router / NAT boxes can have multiple WAN connections for fail-over or load-balancing features. Lower-end boxes will have one WAN connection.




*boxes intended for use with one or five or ten gigabit fiber connections will ~all be faster than boxes intended for DSL-speed ISP connections, whether we’re discussing bridging or routing. Check the box specs for details. Note that gateway / router / NAT boxes performing anti-malware or packet-filtering operations (where those features are available and enabled) can be slower than the rated throughput of the box, due in no small part to the added load involved. Or, in fewer words, “it depends”.

Jan 9, 2026 7:21 AM in response to BobHarris

BobHarris wrote:

Essentially, I am trying to do an advanced thing with beginner knowledge, still having trouble with basic concepts.

Please look at http://tailscale.com

it will minimize the amount of knowledge you need to learn, and let you access your home system remotely and securely.


Ubiquiti gear such as the Express 7 and the Ubiquiti travel router is the hardware analog to that.

Jan 9, 2026 6:10 AM in response to MrHoffman

Thanks to all who have responded, including MrHoffman and BobHarris.


Essentially, I am trying to do an advanced thing with beginner knowledge, still having trouble with basic concepts.


One solution would be for me to give up, get a bigger portable external hard drive for my laptop (not available in 2011!), and use the MacBook Air as my primary computer. It can support one external monitor for when at home, and I could live with that.


That would leave me fully functional anywhere in the world, without an SSH tunnel. So I may just do that.


So I regret you all/both thinking about this further for me, if it ends up just coming down to that.


BUT ... I'm still thinking about this. Some randomly-ordered updates follow.


____


Will this end up all coming down to using Bridge mode? I could ask many more questions, but is this the crux?


Bridge mode: I do find this on the new (cellular broadband) modem/router's internal configuration site, under WAN,  as an alternative to "Route mode". I haven't so far touched it, but I omitted earlier, for simplicity, that I tried turning off the Wi-Fi broadcasting function on the new modem, and connecting it by physical ethernet to my old wireless router (LinkSys), which does allow me to redirect ports. (I had to change its IP from xxx.yyy.1.1 to xxx.yyy.1.2 so as not to conflict with the new modem.) That failed spectacularly, but ...


... is that the situation in which I should try Bridge mode on the new modem?


I found more information about Bridge mode at https://www.geeksforgeeks.org/computer-networks/difference-between-bridge-and-router/, which is very full of techno-jargon, but says that Bridge mode may be slow.


We do not need slow, often streaming two movies at once, already experiencing some minor buffering which we did not get on our previous cable-modem.


But is that why we mean by trying Bridge mode?


Would I specify Bridge mode for Ethernet or for Cellular? (I can do either or both.)


The new (cellular broadband) modem-router has 3 ethernet connections, a blue one labelled "WAN/LAN" and 2 yellow ones labelled "LAN", whereas ...


... the LinkSys Wi-Fi router has 4 blue "ethernet" connections and one yellow ethernet connection labelled "Internet".


Jan 7, 2026 1:55 PM in response to MrHoffman

Thanks, MrHoffman,


Your assumptions are correct. I looked at the MacOS firewall, which I am using, and it is incomprehensible to a mere mortal such as myself; it includes allowed things like sshd-session, which I know has something to do with SSH, as well an nbagent which must have something to do with basketball, and kdc. I clicked the "+" sign and it took me to an ordinary Finder window, so I don't know what to do with that either.


My ISP is a major cellphone-network company with a poor history of customer service, which doesn't seem to have affected its profitability, so I can try that, but I don't think I will get very far.


They recently provided me with this brand-spanking-new cellular broadband modem, not by Ubiquiti, for a price I couldn't turn down, SSH functionality or not, so my only options I think are to return it and go back to my (expensive) cable-modem service, or live with it.


Interestingly, to me, the modem configuration website does list "port forwarding", but it is poorly described in the documentation, and they list in their help files that it is not possible with this model. The port-forwarding page looks like this:



I don't know what most of that means. I know what a WAN and a LAN are, but not what to do with them here. Probably irrelevant to my question.


I have more to learn about traceroute, but this command (names changed):


traceroute server.account@ddns_account.dynamic_dns_server.com


ran for many minutes.


The first line reads (names changed):


www.company-wifi.com (192.168.x.y)  3.359 ms  2.765 ms  2.746 ms


It got up to 64 lines of:


* * *


and then went back to the command-line.


I don't know of any firewall-embedded VPN server. I didn't see anything like that when I looked at the MacOS one in System Settings.


Thanks again!


Jan 9, 2026 7:32 AM in response to MrHoffman

Gateway / router / network address translation (NAT) boxes contain those three general functions — gateway or firewall features for allowing or blocking network traffic, router features for getting packets from the source network to the destination network and a (separate) path for packets from the remote site back (which can or will take separate network routes!), and NAT for dealing with the dearth of IPv4 addresses.

Bridges (and optical network terminals, and unmanaged switches) don’t do any of that. They’re a network connection that provides no added features other than a network path to the next upstream router. Bring your own gateway, router, and NAT features.


Having double NAT configured — two boxes both performing NAT — tends to add network connectivity problems, which is one of the larger reasons for using IPv4 bridging.


I gotta transcribe all this over into a user tip. Ah, well. Probably not today.

Jan 7, 2026 8:31 AM in response to BobHarris

I can't believe that I'm hearing from the great Bob Harris. You changed my life at least as far back as 2011 when you patiently taught me how to construct a safe SSH tunnel using only Terminal commands. Some of my friends would disagree because I talk about my SSH tunnel excessively, because I love it that much; it means that I can access my desktop computer from my laptop from anywhere in the world.


However, this has failed:


ssh -4 server.account@ddns_account.dynamic_dns_server.com


Two primary possibilities occur to me:


  1. my new ISP, a cellphone-network company, just won't let me do this through my new cellular-broadband modem, or
  2. I have more to learn.


If I just can't make it work, then I have a plan for how to make my laptop my primary computer, to retain my portability. That would have to include a portable external hard drive in a capacity not available five years ago.


But I haven't given up on my belovèd SSH tunnel yet!


Charles

External SSH tunnel fails with cellular modem

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.