Linux系统标准化2:将动态IP设置成静态IP&关闭防火墙和Selinux

1.设置固定IP地址

eth0网卡信息如下:

现在我想把我的本地IP固定成192.168.74.128(若不设置,虚拟机默认的动态IP经常变化好麻烦)

1.查看网关地址(我的是192.168.74.2)和子网掩码地址(我的是255.255.255.0)

2.查看DNS,我的是192.168.74.2

3.配置网卡信息, vim /etc/sysconfig/network-scripts/ifcfg-eth0

   配置信息如下

  

2. 关闭防火墙:

##Linux 6
service iptables stop
chkconfig iptables off
chkconfig --list | grep iptables

##Linux 7
systemctl stop firewalld 
systemctl disable firewalld 
systemctl status firewalld 

 3. 关闭selinux:

 

sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0
getenforce

 

posted @ 2017-11-21 06:20  zhuntidaoren  阅读(492)  评论(0编辑  收藏  举报