如何在 OS X 中永久添加路由?

Sri*_*Ram 6 networking static-routes macos

我有一台 Mac Pro,问题是它没有连接到其他 VLAN 中的系统。这可以暂时存档

sudo route -n add -net <IP>/mask  <Gateway>
Run Code Online (Sandbox Code Playgroud)

但是,它会在下一次笔记本电脑重启时消失。如何永久添加路线?

小智 0

找到一篇建议添加类似内容的文章

ifconfig en2 inet 11.22.33.5 netmask 255.255.255.252
route -n add 11.22.33.64/26 111.222.333.6
Run Code Online (Sandbox Code Playgroud)

/etc/rc.common。显然前面的 ifconfig 行是必要的,尽管我不知道为什么。