Unable to view the Public IP of Centos OS

Hello Team,

I followed the instructions to power on the Centos VM using Virtual Box but when I do an “ifconfig”, I don’t see the public IP.

Also, at the bottom of the video, it says that once the Debian VM is up (but we’re talking about CentOS rather than Debian). Please help with that too. As, when I powered on the CentOS VM, and tried to enter /etc directory, I don’t see an /apt directory…Please it’s all too confusing.

Please help.

Thanks & Regards
Tushar

Hello @tusharm78

Try to edit a config file by adding the three lines below:

sudo vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

DNS2=8.8.4.4

DNS1=8.8.8.8

ONBOOT=yes

Save the file and restart the VM

Hey Buddy,

Thank you so much for the solution but again the problem persists.

I’ve added the aforesaid lines in the config file and restarted the VM too:
image

Please assist…thnx

Assign an ip address manually:

  1. $ sudo ifconfig enp0s3 w.x.y.z

Or contact the DHCP server, if it exists, and let it provides an ip address for the interface:

  1. $ sudo dhclient -v enp0s3

If something goes wrong, dhclient will print error messages. They should be used to troubleshoot.