don't ping the main gateway

Issues related to configuring your network
Post Reply
Eger_
Posts: 1
Joined: 2022/03/27 06:57:38

don't ping the main gateway

Post by Eger_ » 2022/03/27 07:46:53

Good afternoon, comrades, I'm a novice sysadmin, I'm trying to raise centos through a virtual machine, but I don't ping the main gateway

my enp --- https://imgur.com/fi5FM9R
my ping --- https://imgur.com/QU9TKuU

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

Re: don't ping the main gateway

Post by jlehtone » 2022/03/27 13:41:47

First, content of files and actual active config are not always identical. That is, changes to files do not always instantly propagate into use.

What does ip ro show?

Second, the gateway is an another machine on the subnet. In your case that is probably the virtualization platform.
Does it agree that it has 192.168.1.1/24 ... wait! What? :o

Your machine has address 192.168.1.200. The subnet prefix is /24 (prefix is way easier to write than a netmask and they do the same thing)
From 192.168.1.200/24 we can calculate that the subnet is 192.168.1.0/24 and the broadcast address is 192.168.1.255.
The valid IP addresses in subnet 192.168.1.200/24 are from 192.168.1.1 to 192.168.1.254.

You have set the gateway to be 192.168.0.1. That address is not in 192.168.1.0/24.
Your machine knows how to send into 192.168.1.0/24, but it does not know how to send to 192.168.0.x.


PS. You are editing config files. CentOS Stream 8 and 9 do use NetworkManager. NM offers tools (nmcli, nmtui) that write the config files for you (and ensure correct syntax). The default connection config also tries to get network config from DHCP server. That ensures that configuration is systematic on all machines that use that DHCP server -- no 192.168.0 vs 192.168.1 mismatches. Does your virtualization platform (Oracle?) offer DHCP server functionality?

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

Re: don't ping the main gateway

Post by TrevorH » 2022/03/27 14:28:36

Check your VM's settings on the host for the networking type you have specified. Some network types will block traffic to other places - for example "hostonly" is a choice and that only let's you talk to the host itself and then only using a DHCP ip address that is obtained from the host.
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

Post Reply