linux服务器添加临时路由,Linux上临时路由、永久路由配置

Linux下查看路由条目

查看路由表命令

route -n

示例

[root@cobbler_vm ~]# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 192.168.101.1 0.0.0.0 UG 0 0 0 ens33

169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33

192.168.101.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33

输出项说明

linux服务器添加临时路由,Linux上临时路由、永久路由配置_第1张图片

配置路由

配置命令

route

命令格式

添加路由

route [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]

删除路由

route [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]

简化版

route [add|del] [-net|-host] target [netm

你可能感兴趣的:(linux服务器添加临时路由)