【问题标题】:Configure eth0 ip address,subnetmask, gateway using bash script [closed]使用 bash 脚本配置 eth0 ip 地址、子网掩码、网关 [关闭]
【发布时间】:2014-01-03 20:52:23
【问题描述】:

我需要使用 bash 更新 /etc/sysconfig/network-script/eth0 当我尝试更新它时,我发现没有任何变化

我正在寻找一个 bash 脚本来使用 bash 脚本配置 eth0 ip 地址、子网掩码、网关...

我该怎么做?

【问题讨论】:

    标签: linux networking centos


    【解决方案1】:

    只需使用 ifconfig 和 route 命令

    ifconfig eth0 192.168.2.123 netmask 255.255.255.0
    route add default gw 192.168.2.1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-02
      • 1970-01-01
      • 2019-08-12
      • 1970-01-01
      • 2017-02-13
      • 2021-12-30
      • 1970-01-01
      • 2015-10-18
      相关资源
      最近更新 更多