zoukankan      html  css  js  c++  java
  • CENTOS系统安装及初始化配置相关 风行天下

    一,配置网卡:

    1,设置网卡ip地址:vi   /etc/sysconfig/network-scripts/ifcfg-eth0 

    DEVICE=eth0
    TYPE=Ethernet
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=none
    IPADDR=192.168.1.90
    NETMASK=255.255.255.0

    2,设置网关:

    [root@localhost 桌面]# cat /etc/sysconfig/network

    NETWORKING=yes

    HOSTNAME=svr5.tarena.com //主机名只有重启后才能生效

    GATEWAY=192.168.8.1 //重启network服务即生效

    [root@localhost 桌面]# /etc/init.d/network restart

    3,设置DNS地址:

    [root@localhost ~]# cat /etc/resolv.conf
    nameserver 114.114.114.114

    最后ping www.baidu.com

    二,关闭防火墙,selinux,NetworkManager

    1,getenforce

    setenforce 0

    2,iptables -F 情况iptables规则

    3,

    关闭NetworkManager服务,禁止开机自启

    分析: NetworkManager服务,是一个独立服务。为Linux图形下管理网络连接的服务, 在RHEL6.5中与network服务有冲突需要关闭。

    命令操作如下所示:

    [root@localhost 桌面]# /etc/init.d/NetworkManager stop

    停止 NetworkManager 守护进程: [确定]

    [root@localhost 桌面]# chkconfig NetworkManager off

    [root@localhost 桌面]# chkconfig --list NetworkManager

    NetworkManager     0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭

    关闭selinux和iptables:
    setenforce 0

    iptables -F
    iptables -t nat -F
    systemctl stop firewalld
    systemctl disable firewalld

    systemctl stop NetworkManager
    systemctl disable NetworkManager

    1 永久方法 – 需要重启服务器

    修改/etc/selinux/config文件中设置SELINUX=disabled ,然后重启服务器。

    2 临时方法 – 设置系统参数

    使用命令setenforce 0

    附:
    setenforce 1 设置SELinux 成为enforcing模式
    setenforce 0 设置SELinux 成为permissive模式

    三,更换yum源

    1、备份

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

    2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

    CentOS 5    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

    CentOS 6    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

    CentOS 7    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    3、之后运行yum makecache生成缓存

    四,U盘安装CENTOS系统

    http://www.osyunwei.com/archives/2307.html

        u盘安装操作系统                    http://blog.51cto.com/9100413/2050146                 (我已经试过,可以使用。)

  • 相关阅读:
    浅谈项目管理之平衡原则
    MediaFoundation初步研究
    只有我一个人觉得cnblogs的页面超丑么?
    Xcode entitlement 问题定位和解决指南
    做游戏,不加班行不行?
    主程的工作职责有哪些?
    第N次开博
    企业级Java电商网站开发(服务端)
    JDK1.8版本特性
    POI操作Excel
  • 原文地址:https://www.cnblogs.com/yaok430/p/8370778.html
Copyright © 2011-2022 走看看