Centos7 网络环境配置

名字和防火墙:

vi /etc/hostname #主机名配置

setenforce 0   # 临时关闭selinux
vim /etc/selinux/config   # 永久关闭selinux,重启之后生效,修改内容SELINUX=disabled
systemctl stop firewalld# 临时关闭防火墙:
systemctl disable firewalld# 永久关闭防火墙,重启后生效:

启动命令:

systemctl restart network   #重启网卡
systemctl restart ***        #重启xx服务
systemctl stop    ***        #停止xx服务
systemctl start   ***        #开启xx服务
systemctl status  ***        #查看xx服务
systemctl enable  ***        #设置开机自启动xx服务
systemctl disable ***        #关闭开机自启动xx服务

 网卡配置文件vi /etc/sysconfig/network-scripts/ifcfg-ens33#名字不一定是这个tab看看差不多的


BOOTPROTO=none #静态获取 dhcp动态获取
IPADDR=192.168.70.88 #IP地址
NETMASK=255.255.255.0 #子网页码
GATEWAY=192.168.70.1 #网关
DNS1=8.8.8.8 #DNS

万兆万卡需要修改:

网卡mtu永久修改方案 vim /etc/rc.local #开机会启动的文件
ifconfig eth0 mtu 9000 #万兆万卡使用
chmod +x /etc/rclocal#赋予执行权限,开机自启动 

配置没问题没网络这个关了试下:

systemctl stop NetworkManager开机没有网络设置没问题试下
systemctl disable NetworkManager

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值