linux系统的网络ip地址没有

				版权声明:本文为博主原创文章,未经博主允许不得转载。					https://blog.csdn.net/JasonHector/article/details/78657532				</div>
							<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
							            <div id="content_views" class="markdown_views prism-atom-one-dark">
						<!-- flowchart 箭头图标 勿删 -->
						<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path></svg>
						<p>没有配置DNS会引起的问题</p>

yum命令
ssh命令等不能进行

错误:

Could not resolve host: centos.ustc.edu.cn;

本文例子: CentOS7 下DNS配置

网络适配器设置,这个地方选择nat模式和桥接模式都可以

这里写图片描述

1.root权限登录终端 输入

$ ip add

这里写图片描述

ens33 为我的名字 记下

2.查找配置文件

$ cd /etc/sysconfig/network-scripts/

这里写图片描述

$ ls

找到刚才对应的名字

这里写图片描述

$ vi ifcfg-ens33

最底下
ONBOOT = yes

这里写图片描述

3.关机重启,然后ping 一下网站看看是否能通

$ shutdown -r now

百度为例

$ping www.baidu.com

这里写图片描述

4.重新查看

$ ip add

这里写图片描述

记录下ip地址

5.进行配置文件添加配置,截止这一步ip已经设置完成,后续工作其实不需要进行

$ cd /etc/sysconfig/network-scripts/

修改原先文件

$ vi ifcfg-ens33

这里写图片描述

后两行最后都为1就可以

6.保存退出 重启

$ shutdown -r now

执行yum 操作

$ yum install perl*

这里写图片描述

				版权声明:本文为博主原创文章,未经博主允许不得转载。					https://blog.csdn.net/JasonHector/article/details/78657532				</div>
							<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css">
							            <div id="content_views" class="markdown_views prism-atom-one-dark">
						<!-- flowchart 箭头图标 勿删 -->
						<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path></svg>
						<p>没有配置DNS会引起的问题</p>

猜你喜欢

转载自blog.csdn.net/good_luck_l/article/details/89081705
今日推荐