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

上一篇:剑指Offer——分治算法


下一篇:linux 终端显示 -bash-4.1