一、添加临时静态路由(即重启后失效)

ip route add 172.22.2.0/24 via 172.22.3.254 dev eno16777984


二、添加永久路由

编辑或新建/etc/sysconfig/network-scripts/route-interface 文件中,比如

vi /etc/sysconfig/network-scripts/route-eno16777984

添加两条路由:

172.22.2.0/24 via 172.22.3.254 dev eno16777984

172.21.0.0/16 via 172.22.3.254 dev eno16777984

添加完后要重启系统或重启网卡:nmcli dev connect eno16777984