1.下载软件
2.启动镜像
i.新建
image.png
ii.设置系统参数
image.png
image.png
iii.设置iso光盘
image.png
image.png
iv.网络设置
image.png
image.png
v.安装centos7
image.png
image.png
3.网络设置
启动后centos处于无网模式,点击查看解决方案。
i.修改vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
。ONBOOT
修改为yes
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=9bcd92b9-dfe8-4511-955a-3e3f70422dae
DEVICE=enp0s3
ONBOOT=yes
ii.重启network
nmcli connection reload
nmcli connection up enp0s3
iii.检查网络设置是否成功
image.png
iv.设置完成后就可以用主机端口登录啦
ssh root@127.0.0.1:2288
4.软件更新
i.安装必要软件
yum install -y yum-utils wget
ii.加速yum: 加速替换yum源
# 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 替换阿里云源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 清除缓存
yum clean all
# 生成缓存
yum makecache
iii.更新软件和内核
yum update -y
iv.安装常用软件
yum install -y net-tools vim git wget lsof tcpdump telnet nc strace lrzsz zip unzip
5.关闭防火墙
i.编辑启动项脚本
vim /etc/rc.d/rc.local
新增最后一行
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
# 关闭防火墙
/usr/bin/systemctl stop firewalld.service
ii.生效启动脚本
chmod +x /etc/rc.d/rc.local