当前位置: 移动技术网 > 网络运营>服务器>Linux > linux系统的初始化配置浅析

linux系统的初始化配置浅析

2019年04月28日  | 移动技术网网络运营  | 我要评论

一.网络的初始化

  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
ipv6init=yes
ipv6_autoconf=yes
ipv6_defroute=yes
ipv6_peerdns=yes
ipv6_peerroutes=yes
ipv6_failure_fatal=no
name=eno16777736
uuid=e8781eab-2865-49a2-9558-46489fda2ab8
device=eno16777736
onboot=yes
ipaddr=192.168.100.112
network=255.255.255.0
gateway=192.168.100.1
dns1=114.114.114.114

二.主机名的修改

  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  

以上所述是小编给大家介绍的linux系统的初始化配置浅析,希望对大家有所帮助

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网