Initial configuration analysis of linux system

  • 2020-05-10 23:24:03
  • OfStack

1. Network initialization

1. Modification of ip address (temporary effect)

Use the ifconfig command

ifconfig network card name ip address subnet mask


[root@localhost /]# ifconfig eno16777736 192.168.100.112/24

1. Modification of ip address (permanent effect)

Modify the network card file in the /etc/sysconfig/ network-scripts directory


[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

2. Host name modification

1. Temporary effect


[root@localhost /]# hostname jw153

2. Effective in perpetuity

Modify the configuration file /etc/hostname


[root@localhost /]# vi /etc/hostname

Save and exit after modification

3. Turn off firewalld and selinux

1. Temporary closure

1. firewalld


[root@localhost /]# systemctl stop firewalld.service  # Effective immediately but will still start when you boot up 

                        2.selinux


[root@localhost /]# setenforce 0 # Set up the SELinux  Become a permissive model  ( It will receive the data, but it will record it )

2. Permanently closed

1. firewalld


[root@localhost /]# systemctl disable firewalld.service  # It will no longer start automatically, but the current state is still on 

2. selinux

Modify the file /etc/selinux/config

Change SELINUX=enforcing to SELINUX=disabled


Related articles: