can not get the update on centos 7 installed on KVM libvirt

Issues related to configuring your network
Post Reply
habib
Posts: 2
Joined: 2024/01/19 20:06:24

can not get the update on centos 7 installed on KVM libvirt

Post by habib » 2024/03/09 07:17:04

Dears;


Please need help, i tried all what I found on the internet but no solution helped me; I installed a new Centos 7 server as hypervisor and it works fine and I installed a libvert and their component to run some VMs on it and it installed well; but when I login to VMs and try to update it still get an error find below the output from the both of them:


*****************Output from Hypervisor:************************

Code: Select all

[root@Centos7-server ~]# date
Sat Mar  9 07:44:37 CET 2024
[root@Centos7-server ~]# yum update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.pt
 * extras: mirrors.pt
 * updates: mirrors.pt
base                                                                                                                               | 3.6 kB  00:00:00     
extras                                                                                                                             | 2.9 kB  00:00:00     
ookla_speedtest-cli/x86_64/signature                                                                                               |  833 B  00:00:00     
ookla_speedtest-cli/x86_64/signature                                                                                               | 1.8 kB  00:00:00 !!! 
ookla_speedtest-cli-source/signature                                                                                               |  833 B  00:00:00     
ookla_speedtest-cli-source/signature                                                                                               |  951 B  00:00:00 !!! 
updates                                                                                                                            | 2.9 kB  00:00:00     
No packages marked for update
[root@Centos7-server ~]# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::c40c:f7ff:fef6:b082  prefixlen 64  scopeid 0x20<link>
        ether c8:0a:a9:c1:ac:e7  txqueuelen 1000  (Ethernet)
        RX packets 378300  bytes 40312730 (38.4 MiB)
        RX errors 0  dropped 55442  overruns 0  frame 0
        TX packets 8  bytes 556 (556.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s29u1u1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:e0:4c:36:24:a2  txqueuelen 1000  (Ethernet)
        RX packets 442418  bytes 117679215 (112.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 41163  bytes 17425149 (16.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether c8:0a:a9:c1:ac:e7  txqueuelen 1000  (Ethernet)
        RX packets 378326  bytes 45625478 (43.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 376 (376.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 65  bytes 4040 (3.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 65  bytes 4040 (3.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.110  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::2e0:4cff:fe36:24a2  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4c:36:24:a2  txqueuelen 1000  (Ethernet)
        RX packets 420004  bytes 110303868 (105.1 MiB)
        RX errors 0  dropped 55443  overruns 0  frame 0
        TX packets 38524  bytes 17423937 (16.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fc54:ff:fe74:37aa  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:74:37:aa  txqueuelen 1000  (Ethernet)
        RX packets 65  bytes 5308 (5.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 475  bytes 70524 (68.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0b1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::6d5d:14cc:9624:63d5  prefixlen 64  scopeid 0x20<link>
        ether 78:e4:00:82:96:bf  txqueuelen 1000  (Ethernet)
        RX packets 320917  bytes 39396039 (37.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 51358  bytes 5652359 (5.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@Centos7-server ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 virbr0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 br0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlp2s0b1
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 virbr0
192.168.1.0     192.168.1.110   255.255.255.0   UG        0 0          0 virbr0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 br0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlp2s0b1
192.168.122.0   192.168.1.210   255.255.255.0   UG        0 0          0 br0
[root@Centos7-server ~]# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              inactive   yes           yes

[root@Centos7-server ~]# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.c80aa9c1ace7       no              enp3s0
virbr0          8000.00e04c3624a2       no              enp0s29u1u1
                                                        vnet0
[root@Centos7-server ~]# virsh net-edit default
<network>
  <name>default</name>
  <uuid>80a852dd-eb86-43c5-9eda-523a81093326</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:44:77:f4'/>
  <ip address='192.168.1.110' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.1.200' end='192.168.1.254'/>
    </dhcp>
  </ip>
</network>
[root@Centos7-server ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     KVMTest                        shut off
 -     Zabbix_server                  shut off

[root@Centos7-server ~]# virsh start Zabbix_server
Domain Zabbix_server started

*********************Container Output :********************

Code: Select all


[root@Centos7-server ~]# virsh console  Zabbix_server
Connected to domain Zabbix_server
Escape character is ^]

CentOS Linux 7 (Core)
Kernel 3.10.0-1160.el7.x86_64 on an x86_64

Zabbix login: root
Password: 
Last login: Mon Feb 26 17:58:38 on ttyS0
[root@Zabbix ~]# 
[root@Zabbix ~]# 
[root@Zabbix ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=26.9 ms
From 192.168.1.110: icmp_seq=2 Redirect Host(New nexthop: 192.168.1.1)
64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=25.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=117 time=24.8 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 24.852/25.628/26.955/0.942 ms
[root@Zabbix ~]# yum update
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#7 - "Failed connect to mirrorlist.centos.org:80; Network is unreachable"


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64
[root@Zabbix ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.201  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::5054:ff:fe74:37aa  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:74:37:aa  txqueuelen 1000  (Ethernet)
        RX packets 413  bytes 63786 (62.2 KiB)
        RX errors 0  dropped 57  overruns 0  frame 0
        TX packets 64  bytes 5266 (5.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@Zabbix ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.110   0.0.0.0         UG        0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
[root@Zabbix ~]# ping mirrorlist.centos.org
PING mirrorlist.centos.org (35.180.43.213) 56(84) bytes of data.
64 bytes from ec2-35-180-43-213.eu-west-3.compute.amazonaws.com (35.180.43.213): icmp_seq=1 ttl=49 time=45.7 ms
From gateway (192.168.1.110): icmp_seq=2 Redirect Host(New nexthop: 192.168.1.1 (192.168.1.1))
64 bytes from ec2-35-180-43-213.eu-west-3.compute.amazonaws.com (35.180.43.213): icmp_seq=2 ttl=49 time=45.2 ms
64 bytes from ec2-35-180-43-213.eu-west-3.compute.amazonaws.com (35.180.43.213): icmp_seq=3 ttl=49 time=44.8 ms

--- mirrorlist.centos.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 44.859/45.273/45.748/0.365 ms
[root@Zabbix ~]# 
[root@Zabbix ~]


User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can not get the update on centos 7 installed on KVM libvirt

Post by TrevorH » 2024/03/09 13:28:14

Why have you installed CentOS 7 now? It dies in June this year.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: can not get the update on centos 7 installed on KVM libvirt

Post by jlehtone » 2024/03/09 18:31:24

Even though CentOS 7 is already "old", its default network management is with NetworkManager.service, so one could use command nmcli to show what system has. If that feels too "new", or if NetworkManager.service has been explicitly replaced with legacy network.service, then tools from iproute2 would be more appropriate: ip li, ip ad, ip ro, and ss. The iproute2 has been "improved" alternative for ifconfig and netroute way over two decades now.

---

You host has two bridges. Why? In addition you have third interface, wlp2s0b1.

All three are in same subnet 192.168.1.0/24. That is definitely something that you should not do (unless you really, really know what you are doing).

Furthermore, the "virbr0" network is routed with NAT. How do you expect traffic to be routed from subnet 192.168.1.0/24 to subnet 192.168.1.0/24? (Your host probably does not know either, so lets say: "badly".)

habib
Posts: 2
Joined: 2024/01/19 20:06:24

Re: can not get the update on centos 7 installed on KVM libvirt

Post by habib » 2024/03/10 09:55:47

TrevorH wrote:
2024/03/09 13:28:14
Why have you installed CentOS 7 now? It dies in June this year.

Thanks for your replay; I installed it now to make a simulation because I have some servers running in centos7 (I didn't participate during the implementation) and I want to move them to the new system; so I want to make some tests on my local server to avoid any problems can I face during my new installation.

Post Reply