修改主机名
hostnamectl set-hostname yunwei.ahctc.com
su
下载vim和wget
yum -y install vim
yum -y install wget
网卡配置
vim /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE="Ethernet"
BOOTPROTO="static"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.1.188
GATEWAY=192.168.1.2
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=114.114.114.114
关闭防火墙
关闭防火墙:
[root@yunwei ~]# systemctl stop firewalld
关闭防火墙开机自启
[root@yunwei ~]# systemctl disable firewalld
补充
开机启动
[root@yunwei ~]# systemctl enable firewalld
查看防火墙状态
[root@yunwei ~]# systemctl status firewalld
启动防火墙
[root@yunwei ~]# systemctl start firewalld
重启防火墙
[root@yunwei ~]# systemctl restart firewalld
关闭SELinux
查看SELinux状态
[root@yunwei ~]# getenforce
临时关闭SELinux
[root@yunwei ~]# setenforce 0
永久关闭SELinux
[root@yunwei ~]# vim /etc/selinux/config SELINUX=enforcing替换为SELINUX=disabled
关闭NetworkManager
[root@yunwei ~]# systemctl stop NetworkManager
[root@yunwei ~]# systemctl disable NetworkManager
配置yum源
#进入/etc/yum.repos.d目录
cd /etc/yum.repos.d
#对所有.repo仓库文件进行tar打包并压缩
tar -zcf repo.tar.gz *.repo
rm -rf *.repo
配置阿里yun仓库
CentOS 镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
Epel 镜像
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
配置本地yum仓库
vim local.repo
[local] name=local yum
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
备注信息
[local] => 仓库标识
name => 仓库名称
baseurl => 仓库路径,本地使用file://+路径,远程使用http://或https://
gpgcheck => gpg密钥校检,0代表安装前不进行gpg校检
enabled => 是否启用此仓库,默认为1,如果不想启用,可以使用0替代
准备完毕后,关机
[root@yunwei ~]# shutdown -h 0