“”ping 8.8.8.8 connect: Network is unreachable“” in centOS 7 on VMware workstation 14

I am trying to work with centOS 7 which I installed on VMware workstation.

But it doesn't have internet connection:

$ ping 8.8.8.8
connect: Network is unreachable
$ ping
ping: Name or service not known

I checked NAT in my virtual machine settings and it is the output of ifconfig command:

ens33: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 00:0c:29:7a:53:87 txqueuelen 1000 (Ethernet) 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
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 504 bytes 44064 (43.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 504 bytes 44064 (43.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:14:b1:67 txqueuelen 1000 (Ethernet) 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

any idea how can I get internet access?

2 Answers

You do not have IP address assigned to your network interface "ens33".

Type "dhclient" in terminal, that should fix the issue, if it does not work, please print output of command "ip addr" from terminal

Regards, Nik

13

You should check your Virtual Machine network config in order to be sure the network adapter is properly mapped. The best way in my opinion is not to NAT, but bridge the adapter to the phisical host apadter. Then your router dhcp server will provide a correct IP to your Centos virtual machine. Anyway you would need to check the Centos network configuration to see if the ip was assigned properly as long as it is the default gateway and DNS server.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like