RHCSA第一天
RHCSA第一天
-
配置IP地址
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp #IPADD=192.168.159.88 DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=2676f21a-6611-43aa-9c66-7ffed789c567 DEVICE=ens33 ONBOOT=yes
- DEVICE 网卡的名字
- HWADDR HWADDR HardWare Address 硬件地址 MAC地址
- TYPE=Ethernet 网络类型 以太网
- UUID #UUID 做到系统中独一无二。
- ONBOOT=yes 在开机或重启网卡的时候是否启动网卡
- NM_CONTROLLED=yes 是否受network程序管理
- BOOTPROTO=none 网卡是如何获取到ip地址 网卡获取ip地址的方式
a. dhcp 自动获取ip地址
b. none 固定的ip地址
c. static 固定的ip地址
- IPADDR=10.0.0.100 IPADDR ip地址
- NETMASK=255.255.255.0 子网掩码 决定这个局域网中最多有多少台机器
- GATEWAY=10.0.0.2 网关 整个大楼的大门
- USERCTL=no 普通用户是否能控制网卡
- /etc/resolv.conf 配置DNS 网卡配置文件的DNS优先于/etc/resolv.conf
- DNS 域名解析器 阿里的域名解析器:223.5.5.5 223.6.6.6
重启网卡 /etc/init.d/network restart
-
关闭防火墙
systemctl stop firewalld.service
-
设置防火墙开机不自启
systemctl disable firewalld.service
-
关闭selinux (临时关闭)
setenforce 0
通过修改配置文件达到永久关闭
[root@localhost ~]# vim /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. #SELINUX=disable即可永久关闭selinux SELINUX=enforcing # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
查看selimux状态
[root@localhost ~]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: disabled Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31