安装完Linux,当用户第一次启动Linux系统时,将进入初始化配置界面。配置IP地址、DNS
一.网络的初始化
1.ip地址的修改(临时生效)
使用ifconfig命令
ifconfig 网卡名 ip地址 子网掩码
[root@localhost /]# ifconfig eno16777736 192.168.100.112/24
1.ip地址的修改(永久生效)
修改/etc/sysconfig/network-scripts 目录下的网卡文件
[root@localhost /]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
二.主机名的修改
1.临时生效
[root@localhost /]# hostname jw153
2.永久生效
修改配置文件 /etc/hostname
[root@localhost /]# vi /etc/hostname
修改后保存退出
三.关闭firewalld和selinux
1.临时关闭
1.firewalld
[root@localhost /]# systemctl stop firewalld.service #立即生效但是开机时仍会启动
2.selinux
[root@localhost /]# setenforce 0 #设置SELinux 成为permissive模式 (会接收数据,但是会记录下来)
2.永久关闭
1.firewalld
[root@localhost /]# systemctl disable firewalld.service #开机时不会再自动启动,但是当前的状态仍然开启
2.selinux
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled