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,然 ...
随机推荐
- rabbitmq - 简单认识
1. 概述 与 rabbitmq 做交互 amqp 最著名的实现 与 jms 最明显的区别 消息 不是去找 queue 而是去找 exchange 2. rabbitmq 基本组件 sender 发送 ...
- AngularJS请求数据提示resource from url not allowed by $sceDelegate policy
AngularJS iframe跨域打开内容时报错 解决方案 使用 $sceDelegateProvider 配置跨域请求域名 config.js app.config(function($sce ...
- 算法刷题--回溯算法与N皇后
所谓回溯算法,在笔者看来就是一种直接地思想----假设需要很多步操作才能求得最终的解,每一步操作又有很多种选择,那么我们就直接选择其中一种并依次深入下去.直到求得最终的结果,或是遇到明细的错误,回溯到 ...
- 数据库持久化框架——MyBatis(1)
叨叨时刻:内容根据阿里云大学的MyBatis视频教程整理而成,有需要最好跟着视频教程走一遍 MyBatis 是支持定制化SQL.存储过程以及高级映射的优秀的持久层框架.MyBatis 避免了几乎所有的 ...
- Django - 美化显示request.META
def index(request): values = request.META.items() html = [] for k, v in values: html.append('<tr& ...
- Multism中的一些特殊元器件在哪里找
1.TLP521-1(光耦)在哪里找 2.单刀双掷开关 3.数码管 indicator:指示器 SEVEN_SEG_DECIMAL_COM_A_BULE: 七段带小数点共阳极,蓝色显示 A:阳极 K: ...
- Vim常用按键大全
Vim完全可以用键盘进行操作.本文将常用的按键归纳总结. 第一部分:一般模式可用的按钮,如光标移动.复制粘贴.查找替换等 移动光标的方法 h, j, k, l 光标向左,下,上,右移动 Ctrl + ...
- django之orm的高级操作以及xcc安全攻击
查询用法大全: 1. 比较运算符 # id > 3 res = models.UserInfo.objects.filter(id__gt=3) # id >= 3 res = model ...
- 1.1、webrtc的历史和现状
1.1.webrtc的历史和现状 本书目录 温馨提示:本书的内容,将按照顺序一一展开,上篇文章阐述本书的诞生的原因,推荐阅读方式等. 如果你还没有阅读上一篇文章(必读前言—— 作者的独白),我建议返回 ...
- 科技股 - 5G、芯片、半导体 细分龙头
5G.芯片.半导体 细分龙头 来源:头条-南山话投资 1.射频芯片:卓胜微 2.存储芯片设计:兆易创新 3.GPU:景嘉微 4.模拟电路芯片:圣邦股份 5.半导体分立器件:扬杰科技 6.晶圆代工:中芯 ...