一、配置网卡(无网环境忽略此条)
vi /etc/sysconfig/network-scripts/ifcfg-ens
BOOTPROTO=static
ONBOOT=yes
systemctl restart network
二、配置本地yum源(有网环境忽略此条)
mkdir /centos7 #存放本地yum源
mount /iso ./tmp #将iso镜像挂载到本地文件中
cp -vrf ./tmp/* /centos7 #将挂载后到本地文件copy到本地yum源文件中
cd /etc/yum.repos.d
mv ./CentOS-* /root/tmp #移除yum到网络源信息
touch yum.repo #编写本地yum
[centos7-yum]
name="yum.local"
baseurl=file:///centos7
gpgcheck=0
enabled=1
yum clean all #刷新缓存
rm -rf /var/cache/yum
yum list #显示数据则表示本地yum配置成功
yum install net-tools #安装net-tools,查看ifconfig
注意:
本地挂载完镜像之后,如果还要使用该文件的话,必须先umount该文件,否则会报错,提示权限不够
三、关闭防火墙及selinux
systemctl disable firewalld
systemctl stop firewalld
vi /etc/sysconfig/selinux
SELINUX=disabled
setenforce 0
getenforce
版权声明:本文为Misaki_root原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。