Unable to connect guest VM to internet (QEMU via both 'User-mode networking' and 'TUN/TAP')

Hello, I installed FreeBSD 10.3 on AQEMU. I can't connect to internet in none
of the modes of "Default, User-Mode Networking" and "TUN/TAP Networking".

I am able to ping my host in the TAP networking mode (192.168.1.33 which is my
IP addr in guest), but getting 'no route to host' for any outside address and
the fetch utility (similar to wget) does not work. I have done instructions in
below web link for TAP networking:

I am also able to ping 10.0.2.15 and 192.168.1.255 in the default User mode
networking.

For me, no matter which method I use. But I will happy if it done via default
mode (User mode network stack).

Thanks for the guidance.

##########

  • System:
    Debian 8.4 on x86-64 machine

  • qemu-system-x86_64 -version:
    QEMU emulator version 2.1.2

  • AQEMU Version:
    0.8.2 of 2011.07.27

##########
On Linux

This is for when I dont using TAP:

$ /sbin/ifconfig 

eth0      Link encap:Ethernet  HWaddr (removed by me)
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:febc0000-fec00000 

eth1      Link encap:Ethernet  HWaddr (removed by me)  
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: (removed by me) Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11233 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11381 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10980966 (10.4 MiB)  TX bytes:1684350 (1.6 MiB)

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

==========

$ ip route
default via 192.168.1.1 dev eth1  proto static  metric 1024 
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.33

##########
Configuration of my modem

LAN > Router Local IP >

IP Address : 192.168.1.1
Subnet Mask : 255.255.255.0

  • Dynamic Route : RIP2-B
  • Direction : NONE
  • Multicast : Disabled
  • IGMP Snoop : Disabled
    DHCP Server : Enabled
    DHCP, Starting IP Address : 192.168.1.33

WAN >

  • ISP : PPPoA/PPPoE
  • Encapsulation : PPPoE LLC
  • Half Bridge : Deactivated
  • NAT : Enable
  • Default Route : Yes
  • Dynamic Route : RIP1
  • Direction : both
  • Multicast : Disabled

##########
On FreeBSD, The guest VM

  • DHCP is enable
  • Broadcast : 10.0.2.255
  • Status : active

##########
AQEMU Network options:

NIC model : Default
VLAN : 0 (in both mentioned modes)

##########

I installed Oracle VirtualBox v4.3.36 and only ticked "NAT Networks" which is default mode from:

File Menu -> Preferences -> Network

then installed FreeBSD on it and it can connected to internet without any problem, altough it has some limitation which of cource these limitations normally don't affect normal network use:

Thanks to SUN Microsystems and Oracle Corporation.

---------- Post updated at 06:53 AM ---------- Previous update was at 03:51 AM ----------

I changed "DNS nameserver" on FreeBSD from:

#bsdconfig
-> Networking Management -> DNS nameservers

and changed it from 127.0.0.1 to 10.0.2.3

problem solved! on VirtualBox I did not have to deal with this problem. I think this problem was created by me, because several times when my modem was turned off I configured ethernet interface on FreeBSD with enabling and disabling DHCP, I'm not sure, just likely.

1 Like