博客
关于我
centos初始化配置工作
阅读量:203 次
发布时间:2019-02-28

本文共 919 字,大约阅读时间需要 3 分钟。

centos 配置网卡

  1. 进入网卡文件夹
    cd /etc/sysconfig/network-scripts
    我的网卡信息
  2. 查看网卡名称,我这里网卡名称是 ifcfg-ens33
  3. vim ifcfg-ens33 编辑该网卡
  4. BOOTPROTO=DHCP改为BOOTPROTO=static
  5. ONBOOT=no改为ONBOOT=yes
  6. 增加IP地址IPADDR=192.168.1.80
  7. 增加子网掩码NETMASK=255.255.255.0
  8. 增加网关GATEWAY=192.168.1.1
  9. 增加DNSDNS1=114.114.114.114
  10. 也可再增加一个DNSDNS2=8.8.8.8
  11. 配置如图我的网卡配置

centos 配置yum源

一条命令完成yum源配置
  • \cp -r /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && curl -fsSL 'http://mirrors.163.com/.help/CentOS7-Base-163.repo' -o /etc/yum.repos.d/CentOS-Base.repo && yum clean all && yum makecache
也可使用以下方式逐步配置yum源
  1. 访问163域名配置yum源
    http://mirrors.163.com/.help/centos.html
  2. 首先备份 /etc/yum.repos.d/CentOS-Base.repo
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  3. 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
  4. 运行以下命令生成缓存
    yum clean all
    yum makecache
流程如图:

在这里插入图片描述

关闭selinux

  • sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 使用命令关闭防火墙
  • reboot 重启主机

转载地址:http://hasi.baihongyu.com/

你可能感兴趣的文章
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No qualifying bean of type ‘com.netflix.discovery.AbstractDiscoveryClientOptionalArgs<?>‘ available
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>