您的位置:首页 > 运维架构 > Linux

red hat7在虚拟机上安装关闭防火墙 配置IP地址 关闭selinux

2015-04-13 13:21 134 查看
虚拟机平台 vm10

ip地址的配置

cd /etc/sysconfig/nework-scripts/

存放网卡的文件与red hat6不一样

redhat6 ifcfg-eth0

redhat7 ifcfg-eno16777736

进入文件修改其参数配置为

TYPE=Ethernet

INBOOT=yes

IPADDR=172.16.8.123

PREFIX=16

保存退出

ifdown ifcfg-eno16777736

ifup ifcfg-eno16777736

ip a

禁用防火墙

在red hat7中防火墙作为一个内核模块,每次一开机就会自动打开,所以写一个脚本文件,在每次一开机时,运行脚本,禁用防火墙

#!/bin/bash

#comment

for i in filter ant mangle raw security; do

iptables -t $i -F

iptables -t $i -X

done;

保存脚本, bash fw.sh运行该脚本

使用iptables -t filter -nL查看防火墙信息

selinux的禁用

vi /etc/selinux/config

将SELINUX=enforcing该为SELINUX=disabled

保存退出,使用reboot重启后,用命令sestatus查看selinux的状态
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐