centos7的网络管理(参考使用)
How to Setup network on centos 7
After installing Centos 7, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.This guide will help you to setup network on centos 7 .
This guide contains network configuration steps both in GUI and command mode.
Setup network on centos 7
let’s start, Type “nmcli d” command in your terminal for quick identification of Ethernet cards installed in your machine.

Here we have 2 interfaces named “enp0s17” and “enp0s18” . it might be different in your case ( Eg: em1 or p4p1 ).
GUI Mode
Recommended for beginners
Step 1 » Type this command “nmtui” to open Network manager and press enter after choosing ” Edit a connection” ( Use TAB for choosing options ) .

Step 2 » Now you can see all network interfaces, choose one and click “Edit“.

» DHCP configuration
Step 3 » For DHCP,
1. Choose “Automatic” in IPv4 CONFIGURATION.
2. Choose Automatic Connect check box.
3. Press OK and quit Network manager.

Now Restart network service by typing below command.
systemctl restart network Now your server will get IP Address from DHCP .
» Static configuration
Step 4 » For manual IP address,
1. Choose “Manual” in IPv4 CONFIGURATION.
2. Add IP Address with Subnet , Gateway and DNS server ( Refer below image ).
3. Choose Automatic Connect check box.
4. Press OK and quit Network manager.

Now Restart network service by typing below command.
systemctl restart network That’s it, Interface will have static IP.
Command Mode
Step 1 » Network interface config files are located in /etc/sysconfig/network-scripts/ directory. Open ifcfg-enp0s17 file ( For interface enp0s17 ) and you can see the content like below.
[root@krizna ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s17
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s17
UUID=7f1aff2d-b154-4436-9497-e3a4dedddcef
ONBOOT=no
HWADDR=00:0C:29:A1:B5:D6
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
» DHCP configuration
Step 2 » For DHCP
Find the below lines in config File.
BOOTPROTO=none and replace with
ONBOOT=no
BOOTPROTO=dhcpNow Restart network service by typing below command.
ONBOOT=yes
systemctl restart network Now your server will get IP Address from DHCP
» Static configuration
Step 3 » For Static IP.
Find the below lines in config File.
BOOTPROTO=none and replace with
ONBOOT=no
BOOTPROTO=static And add the below lines at the end of the file.
ONBOOT=yes
IPADDR=172.27.0.32File will look like below after changes.
NETMASK=255.255.255.0
GATEWAY=172.27.0.1
DNS1=172.27.0.5
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s17
UUID=f0c5b37d-299a-43cb-b74b-618bb252d129
ONBOOT=yes
HWADDR=00:0C:29:A1:B5:CC
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.5
Now Restart network service by typing below command.
systemctl restart networkNow Interface will have static IP.
Additionally you can use /etc/sysconfig/network file for hostname and DNS .
HOSTNAME=server.krizna.com
DNS1=192.168.1.5
DNS2=8.8.8.8
SEARCH=krizna.com
centos7的网络管理(参考使用)的更多相关文章
- CENTOS7 使用网络管理器配置静态IP地址
CENTOS7 的网络配置和CENTOS6有些不同. 如果你想要使用网络管理器来管理该接口,你可以使用nmtui(网络管理器文本用户界面),它提供了在终端环境中配置配置网络管理器的方式. 在使用nmt ...
- linux的服务管理(centos6和Centos7)和网络管理(网卡配置),计划服务cron
服务和网络 管理 init ifcfg ens33 1.服务: Linux系统中提供的功能,统称为服务,如:at服务.cron服务.web服务.FTP服务.sshd服务等. 服务是由已经在运行的进程 ...
- 使用cobbler批量安装操作系统(基于Centos7.x )
1.1 cobbler简介 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使 ...
- Django Linux环境下部署CentOS7+Python3+Django+uWSGI+Nginx(含Nginx返回400问题处理、防火墙管理)
本文将介绍如何在Linux系统上部署Django web项目,本次部署基于下面的架构: CentOS7+ Python3.5 + Django1.11 + uWSGI + Nginx 亲测可行!!按照 ...
- vmware centos7 minimal 配置共享文件夹
使用的是VMware安装CentOS7 minimal版,系统镜像是CentOS-7-x86_64-DVD-1708.iso. 宿主机系统为win10,CentOS7 minimal过程省略,可参考h ...
- 嵌入式开发 centos7 交叉编译环境准备
1. 安装centos7,启动图像化界面. 参考:https://blog.csdn.net/qq_23014435/article/details/74347925 # systemctl get- ...
- vmware安装centos7.5、配置网卡、环境配置
1.vmware安装centos7.5虚拟机 参考连接: https://blog.csdn.net/guo_ridgepole/article/details/78973763 可能遇到的问题 ...
- 006-(成功环境记录)基于Centos7系统部署cobbler批量安装系统
1.1 cobbler简介 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使 ...
- Rancher安装 - CentOS7(Docker)环境
Rancher安装 - CentOS7(Docker)环境 对于开发和测试环境,我们建议通过运行单个Docker容器来安装Rancher.在此安装场景中,您将在单个Linux主机上安装Docker,然 ...
随机推荐
- CentOS: 网络连接故障排除
yum不能正常动作,惯性认为是需要替换BaseURL,结果后来才发现是Gateway不知什么时候被错误设定了,memo如下. 现象表现于yum不能正常动作,确认ping的操作,发现是不能解析DNS [ ...
- win api 音频可视化
暂时记录,改天有时间再完善...其实写好好久了,但以前的代码丢了,重新写一遍.. 原理和 python 的一样,获取输入设备,然后把数据读取到 buffer 中,在绘制出来. 这里要注意两点: 1. ...
- django+vue基础框架:django one对one格式
创建app:python manage.py startapp app01(这里的app01是指名字,可以是a或b等等) 生成迁移文件:python manage.py makemigrations ...
- radhat 6.7修改mac地址方法
vi ifcfg-eth0 #HW……,即注释掉原硬件地址. 再自己照着原地址写:MACADDR="新mac地址" 重启
- html学习-第一集(基本标签)
什么是HTML html是一套规则,浏览器认识的规则 开发者怎么使用html 学习HTML语言 开发后台程序 写HTML文件 从数据库获取数据,然后替换到html中对应的位子(web框架) HTML文 ...
- TOPSIS算法
title: TOPSIS算法 date: 2020-02-24 11:18:06 categories: 数学建模 tags: [评价模型, MATLAB] mathjax: true 定义 C ...
- 【C语言】输入一个年份和月份,输出该月的天数
分析: 三种类型, A.2月比较特殊,平年的2月只有28天,而闰年的2月有 29 天: B.4.6.9.11月: C.其他1.3.5.7.8.10.12月. 代码: /*输入一个年份和月份,输出该月的 ...
- C# DataTable去重,根据列名去重保留其他列
//去掉重复行 DataView dv = table.DefaultView; table = dv.ToTable(true, new string[] { "name", & ...
- 在工业派上使用opencv库的记录
1.在工业派linux操作系统环境下,调用OpenCV库,用python写了第一个查看图片的程序 注意:要进入工业派的terminal 参考:https://www.cnblogs.com/magic ...
- Dism++ 更新管理提示“无法连接服务器”
Dism++ 更新管理提示"无法连接服务器" 下载wsusscn3.cab,放入Dism++安装目录下Config文件夹中.