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

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

CentOS 网卡配置指南

在CentOS系统中配置网络卡(网卡)时,以下步骤将帮助您手动设置静态IP地址:

  • 进入网络配置文件目录

    打开终端,执行命令:

    cd /etc/sysconfig/network-scripts
  • 查看现有网卡信息

    确认网络接口文件的名称。例如,假设您的网卡名称为 ifcfg-ens33

  • 编辑网卡配置文件

    使用vim命令打开对应的网络接口配置文件:

    vim ifcfg-ens33
  • 设置静态IP地址

    根据实际需求,修改以下参数:

    • IP地址
      IPADDR=192.168.1.80
    • 子网掩码
      NETMASK=255.255.255.0
    • 网关
      GATEWAY=192.168.1.1
    • DNS服务器
      DNS1=114.114.114.114DNS2=8.8.8.8
  • 启用静态IP配置

    确保以下参数设置为yes

    ONBOOT=yes
  • 保存并退出vim编辑器

    按下Esc键,输入:wq并回车保存配置。

  • 重新启动网络服务

    为了使配置生效,执行以下命令:

    systemctl restart network

  • CentOS YUM源配置指南

    以下是配置CentOS YUM源的简洁方法:

  • 备份现有配置文件

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载新的YUM镜像文件

    curl -fsSL 'http://mirrors.163.com/.help/CentOS7-Base-163.repo' -o /etc/yum.repos.d/CentOS-Base.repo
  • 清理并生成缓存

    yum clean allyum makecache

  • 关闭SELinux

  • 禁用SELinux

    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
  • 重启系统

    reboot
  • 以上步骤将帮助您完成CentOS系统的网络配置和YUM源设置,同时确保系统安全性。

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

    你可能感兴趣的文章
    nova基于ubs机制扩展scheduler-filter
    查看>>
    Now trying to drop the old temporary tablespace, the session hangs.
    查看>>
    nowcoder—Beauty of Trees
    查看>>
    np.arange()和np.linspace()绘制logistic回归图像时得到不同的结果?
    查看>>
    np.power的使用
    查看>>
    NPM 2FA双重认证的设置方法
    查看>>
    npm build报错Cannot find module ‘webpack/lib/rules/BasicEffectRulePlugin‘解决方法
    查看>>
    npm build报错Cannot find module ‘webpack‘解决方法
    查看>>
    npm ERR! ERESOLVE could not resolve报错
    查看>>
    npm ERR! fatal: unable to connect to github.com:
    查看>>
    npm ERR! Unexpected end of JSON input while parsing near '...on":"0.10.3","direc to'
    查看>>
    npm ERR! Unexpected end of JSON input while parsing near ‘...“:“^1.2.0“,“vue-html-‘ npm ERR! A comp
    查看>>
    npm error Missing script: “server“npm errornpm error Did you mean this?npm error npm run serve
    查看>>
    npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
    查看>>
    npm install CERT_HAS_EXPIRED解决方法
    查看>>
    npm install digital envelope routines::unsupported解决方法
    查看>>
    npm install 卡着不动的解决方法
    查看>>
    npm install 报错 EEXIST File exists 的解决方法
    查看>>
    npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
    查看>>
    npm install 报错 Failed to connect to github.com port 443 的解决方法
    查看>>