centos-1908安装步骤

1.安装一台虚拟机采用centos-1908.iso镜像

2.修改虚拟网络编辑器

*仅主机模式下把使用DHCP服务将ip地址分配给虚拟机取消掉

*子网ip设置成10.0.1.0 子网掩码255.255.255.0

*Nat模式 把使用DHCP服务将ip地址分配给虚拟机取消掉

*子网ip设置成10.0.0.0 子网掩码 255.255.255.0

*点击NAT设置 网关ip修改为 10.0.0.254 点击确认退出

3.修改网卡配置文件

vi /etc/sysconfig/network-scripts/ifcfg-ens33

添加以下内容

scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=10.0.0.40
NETMASK=255.255.255.0

重启网卡

systemctl restart network

**4.**测试下是否可以ping通

ping www.baidu.coom

5.关闭防火墙和liunx

systemctl stop firewalld.service
systemctl disable firewalld.service

setenforce 0
sed -i ‘/^SELINUX/s#enforcing#disabled#g’ /etc/selinux/config

**6.**安装yum源

yum install -y wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

**7.**安装一些必要工具

yum -y install gcc gcc-c++ cmake curl nmap lrzsz unzip zip ntpdate telnet vim tree bash-completion iptables-services ntp dos2unix lsof net-tools sysstat

**8.**同步时间

echo “*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1”>>/var/spool/cron/root

/usr/sbin/ntpdate ntp1.aliyun.com

date

9.关闭网卡适配器

systemctl stop NetworkManager
systemctl disable NetworkManager

发布了1 篇原创文章 · 获赞 0 · 访问量 11

猜你喜欢

转载自blog.csdn.net/weixin_45622841/article/details/105623264