1.直接運行命令(臨時的,重啓以後就失效)code
#ifconfig eth0 192.168.X.X netmask 255.255.255.0
2.或者直接去配置文件裏面修改ip
vi /etc/sysconfig/network-scripts/ifcfg-eth0配置
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=172.18.28.147 NETMASK=255.255.240.0