macos路由配置
# 一、常用命令
# 1.查看网关
networksetup -listallnetworkservices
1
# 2.查看路由
netstat -rn
或
netstat -r
1
2
3
2
3
# 3.添加、删除路由
sudo route add -net 2.0.0.0 10.2.0.1
删除
route -n delete default 192.168.1.1
1
2
3
2
3
# 二、同时访问内外网
1.设置网络顺序 wifi放在第一位置
sudo su
route -n add -net 0.0.0.0 -netmask 0.0.0.0 192.168.2.1
route -n add -net 2.0.0.0 -netmask 255.0.0.0 192.168.1.1
1
2
3
2
3
注:这里的需要访问的内网ip是2开头的 可以添加多个
上次更新: 2023/08/07, 18:08:16