1. 虚拟机软件安装CentOs

1-1. CentOs下载:

http://mirrors.163.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1804.iso

地址:http://mirrors.163.com/centos...

1-2. 百度网盘:https://pan.baidu.com/s/1boIFOC3

密码:v8h3

1-3. 官方下载地址:

https://www.centos.org/download/

2. 准备工作

2-1 查看ip

  1. ifconfig
  2. ip addr
  3. vi /etc/sysconfig/network-scripts/ifconfig-en3

    [root@localhost ~]# cd /etc/sysconfig/network-scripts
    [root@localhost network-scripts]# vi ifcfg-enp0s3

修改ifcfg-enp0s3

    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=f0db1d0a-0102-48c0-8581-d0834f11e4be
    DEVICE=enp0s3
    ONBOOT=yes//no改为yes

执行:service network restart
(此时执行ip addr 网络就是通的)

关机-桥接-启动,此时与电脑网络连接是没有关系的!

2-2 注意:将设置中的网络改为:网络桥接

reboot//重启
yum install net-tools
ifconfig//192.168.1.3

3、替换默认源

  1. wget (下载默认没有安装)
  2. yum install wget
  3. http://mirrors.163.com/.help/... (忽略)
  4. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  5. [root@localhost ~]# cd /etc/yum.repos.d/
  6. [root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/...
  7. 运行以下命令生成缓存
    yum clean all
    yum makecache

3-1. 安装vim

1:[root@localhost yum.repos.d]# yum install vim
2:安装成功后的验证
[root@localhost yum.repos.d]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
可以打开即为正常


双子城
46 声望6 粉丝

just do it!