Linux网卡配置

联通常用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

重启命令:systemctl restart network

 

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

 

posted @   mclind  阅读(183)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示