Files
tldr/pages.zh/osx/route.md
2019-03-15 11:47:29 +00:00

29 lines
566 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# route
> 手动操作路由表.
> 需要root权限.
- 通过网关向目标添加路由:
`sudo route add {{路由ip地址}} {{网关地址}}`
- 通过网关向 子网 / 24 添加路由:
`sudo route add {{子网ip}}/24 {{网关地址}}`
- 在测试模式下运行(不做任何操作,只打印):
`sudo route -t add {{路由ip地址}}/24 {{网关地址}}`
- 删除所有路由:
`sudo route flush`
- 删除特定路由:
`sudo route delete {{路由ip地址}}/24`
- 查找并显示目标的路由主机名或IP地址:
`sudo route get {{目标}}`