标签:repos install sysconf chrony 兼容 连接 ntpd 防火墙 res
# 设置hostname
hostnamectl set-hostname ABC
# 查看网络连接
netstat -lntcp
# 查找软件
rpm -ql python
find /tmp/ "*py*"
# vim安装
yum install vim
# 关闭selinux
vim /etc/sysconfig/selinux 状态改为disabled
# 配置chrony(兼容NTP,可作为NTP服务器)
vim /etc/chrony.conf
server端: server ntp.aliyun.com iburst allow *
chronyc tracking
client端: server server-ip iburst
ntpdate -u IP (-u参数可以越过防火墙与主机同步)
检查chrony情况:chronyc -- sources sourcestas client
# YUM相关
cd /etc/yum.repo
yum search / list / update / remove / makecache /repolist
#关闭网卡
ifup eth0 / ifdown eth0
#配置阿里云镜像
yum install wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e ‘/mirrors.cloud.aliyuncs.com/d‘ -e ‘/mirrors.aliyuncs.com/d‘ /etc/yum.repos.d/CentOS-Base.repo
yum makecache
#配置DNS
vim /etc/resolv.conf nameserver ip
#关闭ipv6
vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1
sysctl -p
若系统正在运行
echo 1>/proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1>/proc/sys/net/ipv6/conf/default/disable_ipv6
或者
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
重启生效
reboot
netstat -lnpt
#netstat command can not fing
yum install net-tools
标签:repos install sysconf chrony 兼容 连接 ntpd 防火墙 res
原文地址:https://www.cnblogs.com/kylingx/p/11616878.html