centos6.4下关闭防火墙,selinux和设置网络

一.关闭iptables

1.iptables -F

2.service iptables save 保存规则

3.service iptables stop 停止

二.关闭selinux

1.vi etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing # 将这个更换为 disabled 
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

2.关闭内存中selinux规则
setenforce 0

三.设置网络

1.vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=08:00:27:E4:54:C4
TYPE=Ethernet
UUID=8097a85f-38b8-4f45-88b7-7070db1e29d5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.200.116
NETMASK=255.255.252.0
GATEWAY=192.168.201.1
DNS1=8.8.8.8

到这里,设置完毕

原文地址:https://www.cnblogs.com/ahwu/p/3441666.html