no internat in vm

chalie001
chalie001 used Ask the Experts™
on
hi there is no internet in my vm but my host got internat
hostnetwwkhost3332.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Is the "Remote NDIS based Internet Sharing Device #3'  the network adapter where your interconnection is at?
With bridged you normally need to be on the host network.

Author

Commented:
am in host
and host got internat
host

Is the "Remote NDIS based Internet Sharing Device #3'  the network adapter where your interconnection is at?=yes
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
can you ping 8.8.8.8 ?

does your VM get a DHCP IP Address from your Network LAN?

what other options have you got if you click the drop down ?
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

nociSoftware Engineer
Distinguished Expert 2018

Commented:
Why aren't you using enp3s0 / emp8s0 on with host system (in the drop down for the bridged interface?) but  "Remote NDIS based Internet Sharing Device #3"
Distinguished Expert 2017

Commented:
Look at /etc/resolv.conf to see if you have name servers defined.

What is 1.1.1.1?
Ping 8.8.8.8
Compare the ip you got on the host and what you have in the VM, they shoukd be on the same network.
If they are not, you have an issue that would explain the issue.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
one.one.one.one (internet!)

8.8.8.8 for the newbies!

quicker and easier to type...
Distinguished Expert 2017

Commented:
Thanks Andrew for the clarification.
The confusing and reason for my question, the lookup was for Google, yet ping was directed at 1.1.1.1.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Some well known DNS servers:
1.1.1.1 is  operated by cloudflare, the IP is borrowed from Chinanet ( owns the networks 1.0.0.0, 1.1.2.0)
9.9.9.9 is operated by Quad 9.
4.2.2.2 is Level 3 DNS service.

There were a few more (4.4.4.4 used to be another, seems non-functional now)

Author

Commented:
am geting
pinghost32hostt
Distinguished Expert 2017

Commented:
Please post the following from host and VM

netstat -rn

Ping often is blocked on certain isp's.

I am looking what IPs the host has and what ip does the VM has as well as the default gateway is for both

Ping the default gateway from host and vm
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
what is IP Address 192.168.56.104

Also does your VM get an IP Address DHCP from your LAN ?
nociSoftware Engineer
Distinguished Expert 2018

Commented:
@arnold: google (8.8.8.8) & cloudflare (1.1.1.1) and Level 3 (4.2.2.2) do allow ping .

ping is just a check for reachability. traceroute will better show  the route and where it blocks.

Host is the machine running VirtualBox
Guest is the machine running inside VirtualBox

interface info:
Windows: ipaddr /all  & netstat -rn
Linux:  ifonconfig -anetstat -rn    on some systems: ip addr showip route show

For ipv4 only give: -4 on netstat & ip commands or IPv6 use -6 on nestat & ip commands.

In this case the router 192.168.56.104 is so friendly to tell it cannot send a packet to the host ... most probably a route failing to send to next gateway.
which might be a problem on the host, or the local adapter.
We are missing info about the network.... (host network range & netmask & default gateway addresses
We are missing info about the host adapter that is connected to the network
We are missing info about: "Remote NDIS based Internet Sharing Device #3"   which might be the same as previous item (should be) but might not.
We are missing info about the guest interface(s)   in the guest: ifconfig -a
What are interfaces enp0s3 & enp0s8? and what are their settings?  ifconfig -a on the system
What is the expected traceroute -I 1.1.1.1
Distinguished Expert 2017

Commented:
Thanks, noci, I am aware..

I posed the request to get the IPs/routing table from the asker.

Andrew provided similar guidance.

Author

Commented:
host
>netstat -rn
===========================================================================
Interface List
  7...40 8d 5c eb c2 b1 ......Realtek PCIe GBE Family Controller
 15...0a 00 27 00 00 0f ......VirtualBox Host-Only Ethernet Adapter #3
 21...00 a0 c6 00 00 00 ......Remote NDIS based Internet Sharing Device #3
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.100    331
          0.0.0.0          0.0.0.0     192.168.56.1    192.168.0.100    331
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.0.0    255.255.255.0         On-link     192.168.0.100    331
    192.168.0.100  255.255.255.255         On-link     192.168.0.100    331
    192.168.0.255  255.255.255.255         On-link     192.168.0.100    331
     192.168.56.0    255.255.255.0         On-link    192.168.56.103    281
     192.168.56.0    255.255.255.0         On-link     192.168.0.100    331
   192.168.56.103  255.255.255.255         On-link    192.168.56.103    281
   192.168.56.115  255.255.255.255         On-link     192.168.0.100    331
   192.168.56.255  255.255.255.255         On-link    192.168.56.103    281
   192.168.56.255  255.255.255.255         On-link     192.168.0.100    331
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link    192.168.56.103    281
        224.0.0.0        240.0.0.0         On-link     192.168.0.100    331
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link    192.168.56.103    281
  255.255.255.255  255.255.255.255         On-link     192.168.0.100    331
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0      192.168.0.1  Default
          0.0.0.0          0.0.0.0     192.168.56.1  Default
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    331 ::1/128                  On-link
 15    281 fe80::/64                On-link
 21    331 fe80::/64                On-link
 21    331 fe80::3c6f:b892:2c04:6c57/128
                                    On-link
 15    281 fe80::6462:52e5:4a56:1ec6/128
                                    On-link
  1    331 ff00::/8                 On-link
 15    281 ff00::/8                 On-link
 21    331 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

host43host321ping322vmnethost.PNG
client322.jpg
ifconfig32.PNG
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
use this device...

Realtek PCIe GBE Family Controller

this is the physical interface you need to bridge to.

So back to very beginning, edit the VM settings, network interface and select Realtek PCIe GBE Family Controller in the drop down.

Restart the VM.
Distinguished Expert 2017

Commented:
you need to post the output from the VM netstat -rn not netstat -n
-n just tells netstat not to resolve IPs/Names
-r tells it to print routing table

Andrew pointed out that you are bridging the VM's network to an incorrect device.

When you adjust as he suggested, your LAN ip on the VM will match the LAN IP on the host, 192.168.0.x
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Multiple default gateways are a recipe for trouble ahead...
Use only one active interface and as a result only ONE default gateway. (after implementing Andrews advice).
If you use your server as a Gateway of some kind (proxy server etc.) then the Internal interface MUST not be configured with a default gateway.

Author

Commented:
i get
adpterroutt3routt43
nociSoftware Engineer
Distinguished Expert 2018

Commented:
and how about enp0s8? (or adapter 2, 3, 4?)

Author

Commented:
adpter 3,4 is empty
adpter421.PNG
nociSoftware Engineer
Distinguished Expert 2018

Commented:
So you need an on host network for adapter 2? (the 10.0.3.0/24 one)... You do NOT want it to be NAT (as that is connected to the larger network).
Please remove the Default gateway for that on the guest.
Distinguished Expert 2017

Commented:
You do not want to attach it to nat, nat means the traffic will go through the host that will function as the router and then out through the physical router in your environemtn.

Change option attached to: bridged
in the third drop down instead of the NDIS  select the Realtec as you have in your last post.
Note you may have to reset/refresh the IP on the VM to get a new IP from the bridged LAN and IP 192.168.0.x.

you could go through the virtualbox console and run
ifconfig enp0s3 down
ifconfig enp0s3 up
that should refresh the IP which is managed through NetworkManager.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
@arnold: adapter 1 = bridged, adater 2 = NAT.. so imho adater 2 should be off ... or unconfigured inside the client.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Do you ever get a IP Address in this VM ?

Author

Commented:
there is no realtec realtec
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
you are selecting the WRONG drop down....

try above.....next to NAME

that option you are selecting is the Virtual Adaptor in the VM! e.g. the virtual interface!
Distinguished Expert 2017

Commented:
need to see the VM;s netstat -rn to see whether the automatic metric assigned to each virtual adapter properly refects that the one on adapater #1 is the preferred path and the one that has the 192.168.0. IP address.

not sure what the purpose of the second one is.

The issue since NetworkManager manages these it could very well be that the wrong adpater is set as primary and in this configuration both get a default gateway and the path is thus set as well by the wrong adapter.

manual configuration of the network interfaces will assure that the NATEd to host adapter will not have a default gateway and would resolve the issue that way.

Author

Commented:
checknetsatrttech
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Lets clean this up a little:
Shutdown the guest.
start from the basic:
On the Host:
    In The virtual box VM setup:
         disable network adapter 2, 3 & 4.
         Enable adapter 1
              Chose the Bridged mode, Realtec  connection.
         (adapter type etc. use defaults).
Startup the Guest:
   Verify:
   - only ONE default gateway exists, (through netstat -rn)
   - that the system has an IP address belonging to the host network connected on the Realtec adapter.

Then try to ping the world...
IF there are problems we need:
  from the host:
 * ipconfig /all
 * netstat -rn
 from the Guest
 * ifconfig -a  
 * ip addr show
 * netstat -rn
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
that is the correct nic you should be using.
Distinguished Expert 2017

Commented:
What is the purpose for the second Nic?
Try disabling the second Nic since currently it seems it is the only Nic that gets an ip,

Author

Commented:
i did adpter
nociSoftware Engineer
Distinguished Expert 2018

Commented:
How did the  guest get the IP address?
DHCP?
Static?

The host network seems to be 192.168.0.0/24   ...
Soo i would also expect a briged guest get  192.168.0.?
also with gateway 192.168.0.100.

So If you have DHCP then the interface in the guest needs to be restarted. ifdown enp0s3 ; ifup enp0s3

If you have a static address then configure the right IP addresses .. in the right network & netmask.
Netmask = 255.255.255.255   (or CIDR =24)
Default gateway  = 192.168.0.100 (just like the host).
The address must be unique on the network.

If your host get the address using DHCP, reconfigure your Guest to also use DHCP.
Distinguished Expert 2017

Commented:
Echo noci's sentiment

The ip in the VM with the primary default gateway on the bridged network, 192.168.0.0/24

That is what is being the obstacle in your VMs access to the Internet.

Author

Commented:
How did the  guest get the IP address?
DHCP?=yes
Static?=no
dwn
If your host get the address using DHCP, reconfigure your Guest to also use DHCP. how do i do this
Distinguished Expert 2017

Commented:
Please note that the fact that your system fails to access the outside provide absolutely no useful information outside the confirmation that you are experiencing issues.

In order to help you resolve your issue there were several requests for info.
From the VM, since the host has access, after the first info from the host, there are no further info needed IMHO.
Ifconfig -a
Netstat -rn

From all being seen is that while your VM was enabled both network interfaces, the functionality is not inherited from the host such that potentially during the install, the "wrong" network card as active and as primary.
Thus is based on your VM being initially configured with two network cards, while the ip it was getting was a natted ip from the host.

One thing to try is to switch the roles on the VM settings nic1 -natted nic2 -briged
This if OS install remains as is, shoukd switch the IPs in use on the VM.
You can later on go through NetworkManager (though often, when I setup a server, I disable the network monitor in favor of other/more basic network handler.)

To handle the second Nic.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Oracle Linux is a derivative of RHEL (Like CentOS).....

So  in /etc/sysconfig/network-scripts
there is a ifcfg-enp0s3  script file.

Inside there is a set of symbol assignments:
Inside there is one: entry
BOOTPROTO=static
(IPADDRESS, NETMASK or PREFIX) etc.
or
BOOTPROTO=dhcp

You want to set BOOTPROTO todhcp using an editor (nano, vi, etc.)

then do:
ifdown enp0s3
ifup enp0s3

and it should start working

Author

Commented:
boostrat the vm is not starting is doing this forever
inet
nociSoftware Engineer
Distinguished Expert 2018

Commented:
No.... !
You didn't get any instruction to put ifup/ifdown in the config script... you were instruct to DO (aka run) the commands.
Now when running ifup (the first time) it will try to run ifup and run ifup and run ifup..... and thus never end running ifup.

Stop the VM. Disable ALL network interfaces.  restart the VM (without network interfaces!!!).

The script ifcfg-enp0s3 is called (or rather sourced) when ifup/ifdown is called from the commandline.
BOOTPROTO=none is in the config script... ==> it will fail to do anything in the future on reboot.

So please edit the ifcfg-enp0s3 script and change BOOTPROTO=none -> BOOTPROTO=dhcp
remove the ifup/ifdown there....
SAVE THE SCRIPT.

Shutdown the VM. Enable network interface 1, restart the VM.

Author

Commented:
i did this still samedisabled

Author

Commented:
thanks i have this now
bootstari did its taking long
dhcp
still no internat
Software Engineer
Distinguished Expert 2018
Commented:
No!...
Change the line BOOTPROTO=none
to BOOTPROTO=dhcp.

BOOTPROTO is a variable
if the contents is none it will not activate the interface
if the value is dhcp it will request info through DHCP.
if you assign BOOTPROTO=none->BOOTPROTO=dhcp then you will set the value to none-
and create a file name BOOTPROTO-dhcp.... which obviously is not what you want....
(we can chat if you like).

Author

Commented:
i did this also
internat32
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Answered via private session. Duration 00:00:07

No effective communication in chat session.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
What is the value of BOOTPROTO in ifcfg-enp0s3?

After you changed this to the dhcp value you need to enable the networkinterface #1 on the vm config.
And restart the machine.

Author

Commented:
thanks noci

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial