I must add a static route on my machine running macOS 13.5 (Ventura).
Online, many tutorials explain how to do so (they all use the same procedure), but I can't make it work. Here is what I have done
networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Thunderbolt Bridge
Wi-Fi
sudo networksetup -setadditionalroutes Wi-Fi 10.244.1.10 255.255.255.255 193.156.100.100
networksetup -getadditionalroutes Wi-Fi
10.244.1.10 255.255.255.255 193.156.100.100
After this, when I try to connect to 10.244.1.10 I get
Unable to connect An error occurred during a connection to 10.244.1.10.
However, If I set the route with sudo route -n add -net 10.244.1.10/32 193.156.100.100, I can reach the site, but (of course) the route is gone after I reboot the machine.
Am I missing something here?
I have read Creating a static route through a specific interface, but I don't see how it solves my problem. Please. help me understand that.
route add ..., which adds a temporary route. – Sig Aug 27 '23 at 13:28route addcommand sets the route, but's it temporary. The answer goes on to say that you need to add it to a LaunchAgent or LaunchDaemon, depending on when you want it to load - when a user logs in or on boot for all users. You put that command in a script and set up a plist. All the instructions are there. – Allan Aug 27 '23 at 14:24networksetupdoes not work, and I have to add the route temporarily every time I boot the machine. I see, thanks. Just out of curiosity, sincenetworksetupdoesn't work, why do all the tutorials out there refer to it? Thanks. – Sig Aug 28 '23 at 19:01