RHCE环境的搭配与验证

目录

一.网络的IP配置

二.yum源的安装

1.在线的yum源

 2.如果网络不通,想安装,配置本地yum源


一.网络的IP配置

1.进入root权限。

[joker@bogon ~]$ su -
Password: 
[root@bogon ~]# 

2.进入nmtui后一直回车后进入IP配置界面,对IP,网关,dns进行配置。

 

 如何查询自己的子网网段

在自己的虚拟机界面点开编辑,找到虚拟网络编辑器点开,点击DHCP设置就可找到自己虚拟机可满足的子网段。

3.配置完成后一直回车[OK],并使用ifconfig命令进行查询是否配置成功。

 4.打开Wired(点击Connent),并在电脑上尝试是否能ping通虚拟机。

 

 能ping通说明与你的电脑连接成功

5.尝试能否ping通www.baidu.com 来检查网络是否连通。

[root@localhost ~]# ping www.baidu.com
PING www.wshifen.com (103.235.46.39) 56(84) bytes of data.
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=1 ttl=128 time=56.7 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=2 ttl=128 time=56.5 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=3 ttl=128 time=56.6 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=4 ttl=128 time=56.7 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=5 ttl=128 time=56.2 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=6 ttl=128 time=56.1 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=7 ttl=128 time=55.10 ms
64 bytes from 103.235.46.39 (103.235.46.39): icmp_seq=8 ttl=128 time=56.8 ms
^Z
[1]+  Stopped                 ping www.baidu.com

 排查网络通畅:

1.确认你的网卡是否有ip(ip,网关,dns) 

2.确认你当前使用的网络模式(NAT)->vmware虚拟机中的vmnat8的网段是多少

3.确认一下你的ip是否和网段匹配

4.如果不行的话,去在你windows上重启一下vmnet8虚拟网卡

二.yum源的安装

1.在线的yum源

 cd /etc/yum.repos.d

 wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

 yum clean all

 yum makecache

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Cetos-8.repo
--2022-01-10 14:59:00--  http://mirrors.aliyun.com/repo/Cetos-8.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 123.138.4.115, 123.138.4.114, 123.138.4.112, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|123.138.4.115|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-01-10 14:59:01 ERROR 404: Not Found.

[root@localhost yum.repos.d]# ls
CentOS-Base.repo  redhat.repo
[root@localhost yum.repos.d]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
0 files removed
[root@localhost yum.repos.d]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.

 2.如果网络不通,想安装,配置本地yum源

1.你的现有软件包,软件包从iso镜像来
  挂载iso镜像到我们文件系统的目录
  mount /dev/sr0 /mnt
2.进入/etc/yum.repo.d/
  vim redhat.repo

[base]
name=base
baseurl=file:///mnt/BaseOS
enabled=1
gpgcheck=0

[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
enabled=1
gpgcheck=0

3. yum clean all
   yum makecache

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

White乄joker

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值