RHEL7安装、ip修改、关防火墙、关selinux、配置yum源

安装时必须创建的分区

  1. /boot          
  2. /     
  3. swap 交换分区,虚拟内存

                swap创建标准:物理内存1.5~2倍,如果物理内存超过4G,一般直接把swap创建4G就够了

一、配置IP地址

RHEL7中弱化了setup的功能,对于网络管理来说,network服务的功能弱化,主要通过NetworkManager对网络进行管理

RHEL7通过nmtui修改网络配置(RHEL7默认安装,前提是需要开启NetworkManager.service 才可以使用)

首先,确定Networkmanager服务正常运行

[root@localhost ~]#systemctl status NetworkManager

●NetworkManager.service - Network Manager

   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service;enabled; vendor preset: enabled)

   Active: active (running)since 二 2016-01-26 20:05:49CST; 43min ago

 如果没有启动,手动启动

[root@localhost ~]#systemctl restart  NetworkManager

 

查看IP地址

[root@localhost ~]#ifconfig

eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.1.62  netmask 255.255.255.0  broadcast 192.168.1.255

        inet6 fe80::20c:29ff:fe0c:e042  prefixlen 64 scopeid 0x20<link>

        ether 00:0c:29:0c:e0:42  txqueuelen 1000  (Ethernet)

       RX packets 6184  bytes 6682795(6.3 MiB)

        RX errors 0  dropped 0 overruns 0  frame 0

        TX packets 4609  bytes 508159 (496.2 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0 collisions 0

 

修改IP地址

[root@localhost ~]#nmtui-edit eno16777736

激活网络配置                                      

[root@localhost ~]# nmtui  激活

或者

[root@localhost ~]#systemctl restart network

 

二、关闭防火墙并设置开机自动关闭

[root@localhost ~]#systemctl stop firewalld

[root@localhost ~]#systemctl disable firewalld

Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Removed symlink/etc/systemd/system/basic.target.wants/firewalld.service.

 

三、关闭selinux并设置开机自动关闭

[root@localhost ~]#setenforce 0                          #临时关闭

 

开机自动关闭:

[root@localhost ~]# sed-i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

 

四、设置光盘开机自动挂载

[root@localhost ~]# echo"/dev/sr0 /mnt iso9660 defaults 0 0" >> /etc/fstab

 

五、配置好本地yum源

[root@localhost ~]# rm-rf /etc/yum.repos.d/*

[root@localhost ~]# cat> /etc/yum.repos.d/rhel7.repo <<EOF

> [rhel7-source]

> name=rhel-source

> baseurl=file:///mnt

> enabled=1

> gpgcheck=0

> EOF

 

[root@localhost ~]# yumclean all                                      #清空yum缓存

[root@localhost ~]# yumlist                                              #生成缓存列表


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值