Linux系統日常運維-修改IP地址
阿新 • • 發佈:2018-11-10
分享下高手寫的很好的文章 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