基本命令
# 添加默認路由
sudo route add -net 0.0.0.0 192.168.191.1
# 删除默認路由
sudo route -n delete default 192.168.191.1
# 獲取默認路由
sudo route get 0.0.0.0
# 添加普通路由
sudo route -n add -net 10.1.0.0/16 192.168.0.1
# 删除普通路由
sudo route delete -net 10.1.0.0/16 192.168.0.1
# 查看路由表
netstat -rn
networksetup -listallnetworkservices
networksetup -getadditionalroutes [網卡]
networksetup -setadditionalroutes ethernet 10.1.0.0 255.255.0.0 172.168.0.1
networksetup -setadditionalroutes ethernet 10.1.0.0 255.255.0.0 172.168.0.1 10.2.0.0 255.255.0.0 192.168.1.1
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!