Linux系统日常运维-修改IP地址

分享下高手写的很好的文章 IP地址、子网掩码、网络号、主机号、网络地址、主机地址

step 0: check the iptables、selinux
service iptables iptables
sestatus -v

step 1: backup the network configuration files
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak
cp /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth1.bak
cp /etc/sysconfig/network /etc/sysconfig/network.bak
cp /etc/resolv.conf /etc/resolv.conf.bak

step 2: update ip address,mask
vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth1

step 3: update the gateway
vi /etc/sysconfig/network

step 4: update the dns
vi /etc/resolv.conf

step 5: restart the network services
service network restart
/etc/init.d/network restart
 

如果您喜欢我,可以通过微信请我喝果汁。

如果有疑问,可以留言或者发邮件给我 lhh_nj@163.com
原文地址:https://www.cnblogs.com/lihuanhuan/p/10612138.html