1.查看系统内核
cat /etc/redhat-release
2.CentOS固定ip
固定ip
vim /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=none #启用静态IP地址
ONBOOT=yes #开启自动启用网络连接
IPADDR=192.168.21.130 #设置IP地址
PREFIX=24 #设置子网掩码
GATEWAY=192.168.21.2 #设置网关
DNS1=8.8.8.8 #设置主DNS
DNS2=8.8.4.4 #设置备DNS
systemctl restart network # 重启网络服务
3.Redhat固定ip
vim /etc/sysconfig/network-scripts/ifcfg-eth0
注意如果错误执行:export PATH="$PATH:/sbin"
service network restart
service iptables status
service iptables stop