Centos7初始化设置 静态IP
2017-04-27 本文已影响22人
行书以鉴
修改 visudo 文件
修改主机localhost名字 永久性修改hostnamectl --static set-hostname ceph-3
设置静态IP
/etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.1.203
NETMASK=255.255.255.0
NETWORK=192.168.1.0
NAME=ens32
DEVICE=ens32
ONBOOT=yes
DNS1=202.96.128.166
设置静态IP网关
/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.254
更新源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
mv CentOS7-Base-163.repo CentOS-Base.repo
yum clean all
yum makecache
yum update -y