目录
一.网络的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=03. yum clean all
yum makecache