Host Interface with wireless working, but only sometimes...

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Nev Delap
Posts: 10
Joined: 14. Jul 2008, 19:15

Host Interface with wireless working, but only sometimes...

Post by Nev Delap »

I am finding that without any configuration changes my Host Interface networking is sometimes working, sometimes only partially, and then in varying degrees of partially.

Note: red bits below are changes I've made according to advice so far, in case you've come back to see the post since.

My host is the latest Ubuntu with all updates, and Virtual Box 1.6.2. configuration...

In if-up.d I have a script doing this...

#!/bin/sh

sysctl net.ipv4.ip_forward=1
VBoxTunctl -b -u nev
ip link set tap0 up
ip addr add 192.168.0.1/24 dev tap0
parprouted wlan0 tap0

This gives me...

eth0 Link encap:Ethernet HWaddr 00:19:b9:5d:3e:89
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:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:22

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:16436 Metric:1
RX packets:1167 errors:0 dropped:0 overruns:0 frame:0
TX packets:1167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36637 (35.7 KB) TX bytes:36637 (35.7 KB)

tap0 Link encap:Ethernet HWaddr 00:ff:7a:da:49:fc
inet addr:192.168.0.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::2ff:7aff:feda:49fc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:128 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:96 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:14010 (13.6 KB) TX bytes:2142 (2.0 KB)

wlan0 Link encap:Ethernet HWaddr 00:1b:77:01:f4:75
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21b:77ff:fe01:f475/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5568 errors:0 dropped:0 overruns:0 frame:0
TX packets:5832 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4188670 (3.9 MB) TX bytes:1297445 (1.2 MB)

wmaster0 Link encap:UNSPEC HWaddr 00-1B-77-01-F4-75-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING 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:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

My guest is Windows XP sp3

with this Virtual Machine config...

Enable Network Adaptor
Attached to: Host Interface
Interface Name: tap0

with this static ip config in Windows...

Windows IP Configuration

Host Name . . . . . . . . . . . . : bananaxp
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Adapter
Physical Address. . . . . . . . . : 08-00-27-9C-85-B4
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 200.149.55.140 200.165.132.147

With other stuff...
  • The wireless router - 192.168.1.1
  • Another real machine plugged into the wireless router - 192.168.1.100
So this is the thing - from the guest...
  • sometimes I can get to everything - the host, the router, the other real machine on the network, and the internet (99, 101, 1, 100, etc).
  • mostly I can get to everything except the other real machine on the network (all except 100) - the host and the real machine have full connectivity.
  • sometimes I can only get to the host (only 99, 101).
  • sometimes I can only get to the default gateway (only 99).
  • sometimes I can't even get to that (can only ping 98 - the guest itself).
And this is all with no config changes - sometimes it's between boots of the real machine, sometimes it's between boots of the virtual machine, but sometimes it changes while everything is running and all I'm doing is pinging stuff from a command prompt inside the guest.

Thanks in advance for your help,

Nev

To the moderator - I wanted to used code blocks - but that doesn't allow me to highlight the configuration that I want to show because bold etc doesn't work- so I've taken them out again - cheers. BTW, I think it would be more readable if code sections were just indented in a monospace font with bold etc available.
Last edited by Nev Delap on 14. Jul 2008, 20:48, edited 6 times in total.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Ok, your 'bridge' actually consists of ICS on the wlan0 adapter to tap0 if I see it right. Then there is one thing that bothers me. With ICS you usually use a different range than the original connection. For Windows it will use 192.168.0.1 for the shared NIC. You can set anything you want, but it's advised not to use the same range as your own internet connection range (and that is 192.168.1.x). I think that if you fix that, it could run a lot more stable.

If it doesn't solve your stability problems, you could try FireStarter firewall. It has an option to share internet from one NIC to the other, like you have now. I kinda feel more comfortable that way as I don't have any experience with this setup.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Nev Delap
Posts: 10
Joined: 14. Jul 2008, 19:15

Post by Nev Delap »

Cheers. I don't know what ICS is, but I still understand what you're saying.

So I've changed it so that the tap is on 192.168.0.1, the Windows XP static config is 192.168.0.2, same subnet mask, and default gateway of 192.168.0.1.

With this config the XP machine can get see itself, it's gateway, and the host (101).

It can't see 100 (the other real machine) or the internet.

Nev
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

ICS means Internet Connection Sharing.

Have you tried Firestarter?

And please, keep the code blocks, they keep the output formatting and tabs, making it a lot easier to see errors. If you want to point out some changes, you can do that with '#<comment>', like you would with config files or scripts ;).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Nev Delap
Posts: 10
Joined: 14. Jul 2008, 19:15

Post by Nev Delap »

Ah, ICS, obvious. Ok, next time I'll do code blocks.

I think I'll wait a little to see if someone else has any ideas before I checkout FireStarter.

Thanks!
Nev Delap
Posts: 10
Joined: 14. Jul 2008, 19:15

Post by Nev Delap »

I've given up trying to get my guest to talk to the whole world through the host interface and instead I've set it up to have two NICs, one using NAT to talk to the world, and one using a host interface called tap1 just to talk to my host.

tap1 is created with uml-utilities and bridge-utils installed, and this script in /etc/network/if-up.d...

Code: Select all

#!/bin/sh

tunctl -t tap1 -u nev
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
ifconfig br0 192.168.0.1
brctl addif br0 tap1
ifconfig tap1 up
chmod 0666 /dev/net/tun
The host NIC in the guest, tap1, is static configured with an ip address of 192.168.0.2, subnet mask 255.255.255.0, and no subnet mask, so all other traffic goes through the NAT NIC.

The entire point was to be able to ftp from the guest to the host in a way that was fast. (ftp'ing through the NAT and the wireless router is very slow, and has to be passive - I don't know why - I just know that ftp'ing through the host interface and not going out on the network is nice and fast).

Cheers.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

For HIF and Host <> Guest communication, a bridge is not needed. All you need is the HIF with an IP address and the Guest system with an address in the same range (no need for gateway). Accessing your Host can be done with NAT if you connect to 10.0.2.2.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Nev Delap
Posts: 10
Joined: 14. Jul 2008, 19:15

Post by Nev Delap »

Yeah, either way I got it partially working. Just never managed to get the guest to see the host, the other computer on the subnet, and the internet all at the same time. But for what I need it's good now. Cheers.
Post Reply