Red Hat Virtual Box: Network is unreachable

16,570

Solution 1

Thanks to Jaroslav Kucera who said that I should assign an ip to eth0.

I followed this article

I modified /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 for DHCP then reboot.

Now I can ping internet.

Solution 2

An additional contribution after chasing the very same complaint for two days: I learned to look for the work " UP " in the NIC line and the br0 line (if present, as they are with virtual machines). I use routinely for both CentOS 7 and RHEL 7 the commands:

# ip  link  set  br0  down
# ip  link  set  br0  up 
# systemctl  reboot

Verify the primary NICs have an " UP " status as well. They usually do.

Solution 3

Had similar issue

Check that you have following added to: /etc/sysconfig/network:

NETWORKING=yes
HOSTNAME=my-hostname

Make sure you have configuration file in respective place (according to your device name): /etc/sysconfig/network-scripts/ifcfg-enp0s3 in my case:

NAME=enp0s3
DEVICE=enp0s3
ONBOOT=yes

Then run: ifup enp0s3
(your device name can be different, for example eth0, so double check that)

Also this command sudo service networking restart might help in some cases.

Related issue: https://serverfault.com/questions/660210/cant-start-centos-7-network-service

Share:
16,570

Related videos on Youtube

elpha01
Author by

elpha01

Updated on September 18, 2022

Comments

  • elpha01
    elpha01 over 1 year

    I installed a RHEL virtual machine with Virtual Box and I can't ping my host computer nor internet.

    I configured 2 adapters:

    1. Attached to NAT, promiscuous allow all and cable connected
    2. Atteched to Bridged Adapter, promiscuous allow all and cable connected

    When I run ip addr show, here is the output:

    ip addr show output

    Thank you.

    • Jaroslav Kucera
      Jaroslav Kucera about 6 years
      First of all, the eth0 has no IP address. So either it receives it from VirtualBox or you should assign it with some of the NAT IP segment (probably 192.168.x.x - you should be able to find it in virtualbox somewhere). The eth1 has no connection (virtual wire) as it says it has NO-CARRIER and is not in LOWER_UP state.
    • elpha01
      elpha01 about 6 years
      Thank you for your clarifications. Can I assign an ip adress to eth0?
    • Jaroslav Kucera
      Jaroslav Kucera about 6 years
      Yes, from proper IP segment.