Cannot reach machine on local net from shell in iTerm2 but can in Terminal - help needed!

63 views
Skip to first unread message

Peter Kingswell

unread,
Dec 31, 2024, 8:23:26 PM12/31/24
to iterm2-discuss
Heyup, I have a bit of a head-scratcher that I need help with. 

This first started happening I guess about a month ago and I only just discovered that the issue *might* be something in iTerm2, by randomly trying commands that were failing there in Terminal and lo and behold, they succeeded. Examples:

Iterm2 /opt/homebrew/bin/zsh output
ping 192.168.2.100                                                                                                                            
PING 192.168.2.100 (192.168.2.100): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
Request timeout for icmp_seq 0
ping: sendto: No route to host
Request timeout for icmp_seq 1
# …
rclone ls My-Term-Home:peter --max-depth=1 # My-Term-Home is configured to 198.168.2.100
2024/12/31 06:46:50 ERROR : : error listing: couldn't connect SMB: dial tcp 192.168.2.100:445: connect: no route to host
2024/12/31 06:46:50 NOTICE: Failed to ls with 2 errors: last error was: couldn't connect SMB: dial tcp 192.168.2.100:445: connect: no route to host

Terminal /opt/homebrew/bin/zsh output

ping 192.168.2.100                                                                                                                            PING 192.168.2.100 (192.168.2.100): 56 data bytes
64 bytes from 192.168.2.100: icmp_seq=0 ttl=64 time=3.212 ms
64 bytes from 192.168.2.100: icmp_seq=1 ttl=64 time=5.061 ms
64 bytes from 192.168.2.100: icmp_seq=2 ttl=64 time=4.077 ms
# …
rclone ls My-Term-Home:peter --max-depth=1                                                                             
    22532 .DS_Store
   273191 .VolumeIcon.icns
      368 ._Dan Carlin - Hardcore History OPUS
# …

  • I tried to eliminate as many variables as possible between iTerm2 and Terminal, for example by diff-ing the `env` in each shell. I unset any env vars until they were about as identical as possible and the issue persisted. 
  • I tried using /bin/zsh in iTerm2 - same results
  • Note that Finder will merrily connect to 192.168.2.100 over SMB just like rclone in the Terminal zsh shell
Can anyone possibly shed any light on this? I’m happy to do further digging.

Should you be a light-shedder, I will be eternally grateful!
Cheers,
Pete 


Richard Mitchell

unread,
Jan 1, 2025, 8:19:34 AM1/1/25
to iterm2-discuss
Apple has changed things.  The default setting is now that apps don't have access to the network - you need to go to security setting and allow iTerm2 access to the network.

Peter Kingswell

unread,
Jan 2, 2025, 6:52:50 PM1/2/25
to iterm2-discuss
OMW
You have saved me so much digging - I thank you from the bottom of my soles! 🙏🏻

Do you think that iterm2 should perhaps have a dialog pop-up upon denied network access? Something like :

     MacOS by default now denies network access, to …

Cancel                         Network Settings

? Just curious as there must be others like me who’ve fallen foul of this most dastardly of changes.
Pete


Reply all
Reply to author
Forward
0 new messages