Virtualbox VM only getting IPv6 over bridge connection. How to get IPv4 address

by Munish Mehta   Last Updated July 12, 2018 01:00 AM

I have launched Ubuntu16.04 in Oracle virtual box on windows 10 machine. I have used two type of adapters: NAT and Bridge Connection. The ip address on Bridge connection is getting IPv6 address and not IPv4. I have already tried updating preference in /etc/gai.conf file. But this change is not making any difference. Not sure what is happening.

I am connecting over (home or office) wifi.

This is what i am getting when i do ifconfig

[email protected]:~$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:9f:b2:ae  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::d279:a2f3:ceec:7c63/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:930 (930.0 B)  TX bytes:6645 (6.6 KB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:f1:ae:d5  
          inet6 addr: fe80::1bc:78a1:8d5e:90ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1083 (1.0 KB)  TX bytes:4363 (4.3 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2386 (2.3 KB)  TX bytes:2386 (2.3 KB)

However, strange part is when i connect over wifi on mobile tethering, i am getting IPv4 for enp0s8

[email protected]:~$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:9f:b2:ae  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::d279:a2f3:ceec:7c63/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1919 (1.9 KB)  TX bytes:7121 (7.1 KB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:f1:ae:d5  
          inet addr:192.168.43.175  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: fe80::1bc:78a1:8d5e:90ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2751 (2.7 KB)  TX bytes:6492 (6.4 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:48 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3402 (3.4 KB)  TX bytes:3402 (3.4 KB)

Please suggest how can i get IPv4 over Wifi connection.



Related Questions



Router behind router

Updated May 13, 2015 16:00 PM


Distributed DHCP probabilities

Updated April 15, 2017 16:00 PM