2021-07-22 14:48:20 +08:00
|
|
|
# Route 命令
|
|
|
|
|
|
|
|
```bash
|
2021-12-27 14:51:42 +08:00
|
|
|
# 查看当前路由配置
|
|
|
|
route -n
|
|
|
|
|
|
|
|
# 添加默认网关
|
|
|
|
route add default dev <netif>
|
|
|
|
route add default gw 192.168.56.1
|
|
|
|
route add default gw 192.168.56.1 dev <netif>
|
|
|
|
# 删除默认网关
|
2021-07-22 14:48:20 +08:00
|
|
|
route del default
|
2021-12-27 14:51:42 +08:00
|
|
|
route del default dev <netif>
|
|
|
|
|
|
|
|
# 设置
|
|
|
|
route add -net <target ip> netmask <mask> [gw <gateway ip>] [metric <跃点信息>] dev <netif>
|
|
|
|
# 删除
|
|
|
|
route del -net <target ip> netmask <mask> [gw <gateway ip>] [metric <跃点信息>] dev <netif>
|
2021-07-22 14:48:20 +08:00
|
|
|
```
|