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,然 ...
随机推荐
- JS中constructor属性
constructor属性用于对当前对象的构造函数的引用.可以用来判断对象的类型: <script> var newStr = new String("One world One ...
- JS中的字符串可以直接调用字符串对象的属性和方法
在JS中,会自动在字符串与字符串对象之间进行转换,因此,任何一个字符串常量都可以看作是一个String对象,其可以直接作为对象使用,只要在字符串变量的后面加 “.” 便可以直接调用String对象的属 ...
- 极客从CPU选择开始-CPU详解
先来看看CPU天梯图(来自(快科技CPU性能天梯图)[https://www.mydrivers.com/zhuanti/tianti/cpu/index.html]) Intel VS AMD (P ...
- 02-Spring的IOC示例程序(通过id获取对象)
*******通过IOC容器创建id对象并为属性赋值******** 整体结构: ①创建一个java工程 ②导包 ③创建log4j.properties日记配置文件 # Global logging ...
- css中定义变量
css中定义变量 定义变量可分多种情况: 1.定义全局变量 :root { --borderColor: #ccc;} 2.定义某元素下的变量 .look{ --borderColor: #ccc;} ...
- 图片上传至/target/upload目录下后,通过ip:port/upload/无法访问
做以下配置即可 @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { try { registry ...
- Java进阶学习(1)之类与对象(下)
类与对象 函数与调用 函数是通过对象来调用的 this 是成员函数的特殊的固有的本地变量 它表达了调用这个函数的那个对象 调用函数 通过 . 运算符,调用某个对象的函数 在成员函数内部直接调用自己(t ...
- as中怎么下载更新platforms和build-tools
链接:https://blog.csdn.net/sunbinkang/article/details/78632652
- [Python] Tkinter的食用方法_01_简单界面
#开始 放假之后感觉整个人已经放飞自我了,完全不知道自己一天天在干什么,明明有很多的事情需要做,但是实际上每天啥都没做,,,虚度光阴... 晚上突然心烦意乱,开始思考今天一天都做了什么,感觉很有负罪感 ...
- 获取度量数据:创建服务账户获取访问token
kubectl create clusterrolebinding kubelet-api-test --clusterrole=system:kubelet-api-admin --servicea ...