Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

手动恢复网关

icymind edited this page Aug 14, 2017 · 4 revisions

如果出 bug 造成无法上网或者无法解析域名, 而 VRouter 又无法恢复系统默认网关.可以手动恢复:

# 查找你的路由器地址, 假设命令输出1.2.3.4
/usr/sbin/networksetup -getinfo Wi-Fi | grep Router

# 恢复网关
sudo /sbin/route change default 1.2.3.4

# 恢复DNS
sudo networksetup -setdnsservers Wi-Fi 1.2.3.4

# 确认网关已恢复
/usr/sbin/netstat -nr | grep default | awk '{print $2}'

# 确认DNS已恢复
/usr/sbin/networksetup -getdnsservers Wi-Fi
Clone this wiki locally