zoukankan      html  css  js  c++  java
  • centos 7 增加永久静态路由

    1 在 /etc/sysconfig/network-scripts/ 目录下添加route-eth3,eth3为实际网卡名称。
    [root@compute1 ~]# cat /etc/sysconfig/network-scripts/route-eth3
    121.14.46.1/32 via 10.160.20.129 dev eth3
    2 重启eth3
    [root@compute1 ~]# ifdown eth3 && ifup eth3
    成功断开设备 "eth3"。
    连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/11)
    3 查看路由表
    [root@compute1 ~]# ip route
    default via 10.160.20.1 dev eth0 proto static metric 100
    10.160.20.0/26 dev eth0 proto kernel scope link src 10.160.20.23 metric 100
    10.160.20.128/26 dev eth3 proto kernel scope link src 10.160.20.131 metric 103
    121.14.46.1 via 10.160.20.129 dev eth3 proto static metric 103
    192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
    备注:生产环境如果不想重启添加路由的网卡,可以先编辑route-eth3文件,加一条临时路由生效,下次重启服务器,系统自然会去读取route-eth3文件,不需要再添加。
    [root@compute1 ~]# ip route add 121.14.46.1/32 dev eth3 via 10.160.20.129


  • 相关阅读:
    php system()和exec()差别
    linux目录中 /usr/local/bin 和 /usr/bin和/usr/local/etc
    mac rar命令相关
    php迭代器
    linux下的find文件查找命令与grep文件内容查找命令
    php 类中的静态属性
    mysql 语句执行顺序
    mysl
    MySQL中concat函数
    animation效果
  • 原文地址:https://www.cnblogs.com/cloud-datacenter/p/12357293.html
Copyright © 2011-2022 走看看