练习实验初始化设置

修改主机名

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值