2

Linux常用命令-29:route

 1 year ago
source link: https://xugaoxiang.com/2022/06/07/linux-cmds-29-route/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

route 命令用来显示和设置 linux 中的网络路由信息,这里的路由指的是静态路由。要注意的是,route 命令也是不会永久保存的。

语法格式:route [参数]

常用参数:

33c4f277a921e676.png
# 显示当前路由
route

# 添加一条路由,多网卡可以通过dev来指定
route add -net 192.168.1.1 netmask 255.255.255.0 dev eth0

# 删除默认路由
route del default gw 192.168.1.1

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK