【发布时间】:2014-01-03 20:52:23
【问题描述】:
我需要使用 bash 更新 /etc/sysconfig/network-script/eth0 当我尝试更新它时,我发现没有任何变化
我正在寻找一个 bash 脚本来使用 bash 脚本配置 eth0 ip 地址、子网掩码、网关...
我该怎么做?
【问题讨论】:
标签: linux networking centos
我需要使用 bash 更新 /etc/sysconfig/network-script/eth0 当我尝试更新它时,我发现没有任何变化
我正在寻找一个 bash 脚本来使用 bash 脚本配置 eth0 ip 地址、子网掩码、网关...
我该怎么做?
【问题讨论】:
标签: linux networking centos
只需使用 ifconfig 和 route 命令
ifconfig eth0 192.168.2.123 netmask 255.255.255.0
route add default gw 192.168.2.1
【讨论】: