码迷,mamicode.com
首页 > 系统相关 > 详细

Linux网卡配置

时间:2019-02-26 23:42:03      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:linu   防火墙   process   service   loaded   firewall   sys   add   ike   

联通常用DNS:

202.102.224.68

202.102.227.68

阿里DNS:

223.5.5.5

电信:

222.85.85.85

CentOS7网卡配置:

[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE="Ethernet"

PROXY_METHOD="none"

BROWSER_ONLY="no"

BOOTPROTO="static"

DEFROUTE="yes"

IPV4_FAILURE_FATAL="no"

IPV6INIT="yes"

IPV6_AUTOCONF="yes"

IPV6_DEFROUTE="yes"

IPV6_FAILURE_FATAL="no"

IPV6_ADDR_GEN_MODE="stable-privacy"

NAME="ens33"

UUID="772475e4-5aeb-426b-8e42-3b918d25d8e6"

DEVICE="ens33"

ONBOOT="yes"

IPADDR=192.168.123.171

NETMASK=255.255.255.0

GATEWAY=192.168.123.1

CentOS7路由配置

[root@centos7 ~]# cat /etc/resolv.conf

#Generated by NetworkManager

search stu.mc

nameserver 222.85.85.85

nameserver 223.5.5.5

CentOS6网卡配置:

[root@centos6 ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

UUID=2bd086a4-d50d-4491-bd63-94bb7a0560b8

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

HWADDR=00:0C:29:B2:E8:00

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"

IPADDR=192.168.123.161

NETMASK=255.255.255.0

GATEWAY=192.168.123.1

CentOS6路由配置:

[root@centos6 ~]#cat /etc/resolv.conf

#Generated by NetworkManager

search stu.mc

#No nameservers found; try putting DNS servers into your

#ifcfg files in /etc/sysconfig/network-scripts like so:

#DNS1=xxx.xxx.xxx.xxx

#DNS2=xxx.xxx.xxx.xxx

#DOMAIN=lab.foo.com bar.foo.com

nameserver 222.85.85.85

nameserver 223.5.5.5

关闭防火墙:

CentOS6:

service iptables stop

chkconfig iptables off

CentOS7:

systemctl stop firewalld

systemctl disable firewalld

SELinux

临时关闭:setenforce 0

[root@centos6 ~]#cat /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

#SELINUXTYPE= can take one of these two values:

#targeted - Targeted processes are protected,

#mls - Multi Level Security protection.

SELINUXTYPE=targeted

Linux网卡配置

标签:linu   防火墙   process   service   loaded   firewall   sys   add   ike   

原文地址:https://blog.51cto.com/14216480/2355333

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!