Centos系统配置静态ip及网络设置
程序员文章站
2022-06-03 18:45:06
...
1.修改主机名称
[root@centos ~]# vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.17.2
2.修改网卡
[root@centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROT=static
IPADDR=192.168.17.128
GATEWAY=192.168.17.2
NETMASK=255.255.255.0
ONBOOT=yes
DNS1=192.168.17.2
3.重新启动网络配置
[root@centos ~]#service network restart