CentOS7 after installing the initial configuration


Turn off selinux and firewalld, configure the network
getenforce
setenforce 0
vi /etc/selinux/config
SELINUX=disabled
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
# Check for an IP address
ip add
# Startup and shutdown the network adapter
ifup
ifdown
# Configure the network adapter
vi /etc/sysconfig/network-scripts/ifcfg-eno16777728
BOOTPROTO=static
IPADDR=192.168.1.99
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.100
NM_CONTROLLED=no
# Add a separate DNS server address
echo ‘DNS1=192.168.1.100’>>/etc/sysconfig/network-script/ifcfg-eno16777728
Add #DNS servers records
vi /var/named/example.zone
vi /var/named/192.168.1.zone
# Configure the hostname
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=lin26.example.local
# Restart network services
1
systemctl restart network
# Use a local repo
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.* /etc/yum.repos.d/backup
vi /etc/yum.repos.d/lin01.repo
[base]
name=lin01
baseurl=http://lin01.example.local/cdrom
enable=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum update
# Use aliyun repo
vi /etc/yum.repos.d/aliyun.repo
[base]
name=aliyun
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/
enable=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum update
# Configure the time zone and time synchronization
tzselect
yum install -y ntpdate
# And time difference servers cannot be more than 1 day
ntpdate -d lin01.example.local
vi /etc/crontab
00 */1 * * * root /usr/sbin/ntpdate lin01.example.local;/sbin/hwclock -w
# Set time manually
date -s 11/16/2015
date -s 18:28:00
hwclock -w
# NET-tools installed, view the start of services and ports
yum install -y net-tools
netstat -ntupl
# Shutdown, restart, and cancel the operation
shutdown -P
shutdown -r
shutdown -c
reboot
# Shutdown from the write buffer to disk to ensure integrity of data
sync