1.配置网卡

  1. [root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
  2. TYPE=Ethernet
  3. BOOTPROTO=static
  4. DEFROUTE=yes
  5. PEERDNS=yes
  6. PEERROUTES=yes
  7. IPV4_FAILURE_FATAL=no
  8. IPV6INIT=yes
  9. IPV6_AUTOCONF=yes
  10. IPV6_DEFROUTE=yes
  11. IPV6_PEERDNS=yes
  12. IPV6_PEERROUTES=yes
  13. IPV6_FAILURE_FATAL=no
  14. NAME=eno16777736
  15. UUID=a73f070f-5c43-4817-89d0-6ab78cc60fe6
  16. DEVICE=eno16777736
  17. ONBOOT=yes
  18. IPADDR=192.168.200.50
  19. NETMASK=255.255.255.0
  20. GATEWAY=192.168.200.2
  21. DNS1=114.114.114.114
  22. // 重启网络
  23. [root@localhost ~]# systemctl restart network

2.关闭防火墙

  1. // 临时关闭
  2. [root@localhost ~]# systemctl stop firewalld
  3. // 永久关闭
  4. [root@localhost ~]# systemctl disable firewalld
  5. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  6. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
  7. // 关闭selinux
  8. [root@localhost ~]# setenforce 0
  9. [root@localhost ~]#vim /etc/selinux/config
  10. # This file controls the state of SELinux on the system.
  11. # SELINUX= can take one of these three values:
  12. # enforcing - SELinux security policy is enforced.
  13. # permissive - SELinux prints warnings instead of enforcing.
  14. # disabled - No SELinux policy is loaded.
  15. SELINUX=disable
  16. # SELINUXTYPE= can take one of three two values:
  17. # targeted - Targeted processes are protected,
  18. # minimum - Modification of targeted policy. Only selected processes are protected.
  19. # mls - Multi Level Security protection.
  20. SELINUXTYPE=targeted

3.挂载配置yum源

  1. // 挂载
  2. [root@localhost ~]# mkdir /opt/centos
  3. [root@localhost ~]# mount -o loop /dev/cdrom /opt/centos/
  4. // 其他文件移到media
  5. [root@localhost ~]# mv /etc/yum.repos.d/* /media/
  6. // 配置yum源
  7. [root@localhost ~]# vim /etc/yum.repos.d/local.repo
  8. [centos]
  9. name=centos7
  10. baseurl=file:///opt/centos
  11. gpgcheck=0
  12. enable=1
  13. [root@localhost ~]# yum clean all
  14. [root@localhost ~]# yum repolist
  15. // 安装依赖
  16. [root@localhost ~]# yum install -y vim net-tools unzip gcc tree