# 查看IP网卡信息
ifconfig -a
# 流量变化大一般就是在使用的网卡
watch cat /proc/net/dev
# root用户
vi /etc/sysconfig/network-scripts/ifcfg-eth0 # 编辑对应网卡 # ifcfg-eth0:网卡
编辑,填写ip地址、子网掩码、网关、DNS等
# 重启网卡
service network restart
ifup eth1 # 激活 eth1网卡
ifdown eth1 # 关闭 eth1网卡
- 禁用网卡
vi /etc/sysconfig/network-scripts/ifcfg-eth1
# 完全禁用网卡
onboot=NO
- 防火墙开启和关闭
# 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
# 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off