Mac:
sudo route -n add -net 192.168.xx.0 -netmask 255.255.255.0 xx.xx.x.xx
Windows:
route -p add 192.168.xx.0 mask 255.255.255.0 xx.xx.x.xx
Mac永久添加路由:
在Launchpad 中找到 Automastor 制作工具, —> 实用工具—> 双击 运行 AppleScript —>


输入:
on run {input, parameters}
(* Your script goes here *)
do shell script "sudo route -n add -net 192.168.xx.x -netmask 255.255.255.0 xx.xx.x.xx" user name “用户名" password "密码" with administrator privileges
return input
end run
保存(ommand + s) 为 Route_MAC.app 文件.
双击该文件执行
在终端中执行netstat -rn 查看是否添加成功.(或者直接 ping 一下服务器地址)
在系统偏好设置中, —> 用户与群组 —>
重启测试是否开机设置成功
网友评论