设置网卡eth0 的IP为192.168.12.10 子网掩码为255.255.255.0,并重启网络服务
1. 编辑网卡配置文件:
```shell
vi /etc/sysconfig/network-scripts/ifcfg-eth0
```
2. 修改配置文件中的内容:
```shell
DEVICE="eth0" #网卡名字,不用修改
BOOTPROTO="static" #设置为静态IP
IPADDR=192.168.12.10 #设置IP地址
NETMASK=255.255.255.0 #设置子网掩码
ONBOOT="yes" #开机启动此连接
```
3. 重启服务:
```shell
service network restart #重启服务
```
免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。