Centos 7.X ifconfig 命令找不到
yum search ifconfig –查看ifconfig位置

yum -y install net-tools.x86_64 –安装 ifconfig 命令
创建临时IP
ifconfig ens33:1 192.168.228.130 netmask 255.255.255.0 broadcast 192.168.228.2 up
关闭临时IP
ifconfig ens33:1 192.168.228.130 netmask 255.255.255.0 broadcast 192.168.228.2 down
设置永久生效
vi /etc/rc.local
将上一行粘贴进rc.local中

给rc.local执行权限
chmod +x /etc/rc.d/rc.local
备注:涉及到的网卡名称、IP、网关、掩码等,均为当前环境下信息,创建时需根据实际环境。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182964.html原文链接:https://javaforall.net