centos6|centos7防火墙区别 | 网络配置区别

 CentOS 6

Linux防火墙

service iptables status (功能描述:查看防火墙状态)

chkconfig iptables –list (功能描述:查看防火墙开机启动状态)

service iptables stop (功能描述:临时关闭防火墙)

chkconfig iptables off (功能描述:关闭防火墙开机启动)

chkconfig iptables on (功能描述:开启防火墙开机启动)

Centos7

Linux防火墙

# vi /etc/sysconfig/selinux

将设置改为禁用:SELINUX=disabled,如图:

# systemctl stop firewalld.service(关闭防火墙)

# systemctl disable firewalld.service(防火墙开机禁用)

 

######################################################################################################

CentOS6

)Linux网络配置

# vi /etc/udev/rules.d/70-persistent-net.rules

复制ATTR{address}=="00:0c:29:e1:bc:79"引号中的值到ifcfg-etho0中

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

配置如下:

DEVICE=eth0
HWADDR=00:0C:29:E1:BC:79
TYPE=Ethernet
UUID=a6713a48-ce04-4bb5-9e4d-8f929976196c
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.122.10
GATEWAY=192.168.122.2
NETMASK=255.255.255.0
DNS1=114.215.126.16
DNS2=192.168.122.2

CentOS7

)Linux网络配置

# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="43d220b2-1f75-4811-8a4b-2cf798f36b46"
DEVICE="eno16777736"
ONBOOT="yes"
DNS1="192.168.122.2"
DNS2="202.102.227.68"
IPADDR=192.168.122.200
PREFIX=24
GATEWAY=192.168.122.2
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
NETMASK=255.255.255.0

 

posted @ 2019-05-16 09:04  zhangqi0828  阅读(258)  评论(0编辑  收藏  举报