host-only networking -- default route?
Posted: 27. Feb 2013, 14:51
After having worked for a while with NAT,
I am now giving "host-only networking" a try.
There are quite a few reasons to consider "host-only networking" the right thing for me now:
The guests can see each other,
I can see the Samba server running in a guest,
I can communicate with guests w/o going through forwarded weird port numbers.
So ...
I see eth0 and eth1 in my guest (for details see below!),
I understand eth0 is for internal networking,
and eth1 is the bridge.
Shouldn't there also be a default route
in order to determine how the guest reaches "the world" through the bridge?
I had a few attempts like this:
$ route add default dev eth1
# Update: this choice seems to work with a bridge over a wifi adapter connected to one wifi but not to another one.
# The VirtualBox host itself does not have a problem with either of the two wifis.
$ route add default gw 192.168.43.40
$ route add default gw 192.168.43.140 # the other end of the bridge within OS X
but to no success ;-(
I seem to not be able to see "the world", as I usually am using NAT as networking mode.
I ran out of ideas.
I am very happy to supply you with more details than the ones below.
Can you give me any hints?
Thanks in advance!
JH60
----------
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:44:F7:2F
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00
fe44:f72f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41374 errors:0 dropped:0 overruns:0 frame:0
TX packets:35457 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12617162 (12.0 Mb) TX bytes:35411893 (33.7 Mb)
eth1 Link encap:Ethernet HWaddr 08:00:27:8E:E8:31
inet addr:192.168.43.40 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::a00
fe8e:e831/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5908 errors:0 dropped:0 overruns:0 frame:0
TX packets:2316 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:517817 (505.6 Kb) TX bytes:286636 (279.9 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:16436 Metric:1
RX packets:782 errors:0 dropped:0 overruns:0 frame:0
TX packets:782 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:55561 (54.2 Kb) TX bytes:55561 (54.2 Kb)
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.43.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
--
I am using 4.2.6 on OS X (10.7.5).
Guest OS: openSUSE 12.2 (x86_64).
I am now giving "host-only networking" a try.
There are quite a few reasons to consider "host-only networking" the right thing for me now:
The guests can see each other,
I can see the Samba server running in a guest,
I can communicate with guests w/o going through forwarded weird port numbers.
So ...
I see eth0 and eth1 in my guest (for details see below!),
I understand eth0 is for internal networking,
and eth1 is the bridge.
Shouldn't there also be a default route
in order to determine how the guest reaches "the world" through the bridge?
I had a few attempts like this:
$ route add default dev eth1
# Update: this choice seems to work with a bridge over a wifi adapter connected to one wifi but not to another one.
# The VirtualBox host itself does not have a problem with either of the two wifis.
$ route add default gw 192.168.43.40
$ route add default gw 192.168.43.140 # the other end of the bridge within OS X
but to no success ;-(
I seem to not be able to see "the world", as I usually am using NAT as networking mode.
I ran out of ideas.
I am very happy to supply you with more details than the ones below.
Can you give me any hints?
Thanks in advance!
JH60
----------
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:44:F7:2F
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41374 errors:0 dropped:0 overruns:0 frame:0
TX packets:35457 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12617162 (12.0 Mb) TX bytes:35411893 (33.7 Mb)
eth1 Link encap:Ethernet HWaddr 08:00:27:8E:E8:31
inet addr:192.168.43.40 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::a00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5908 errors:0 dropped:0 overruns:0 frame:0
TX packets:2316 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:517817 (505.6 Kb) TX bytes:286636 (279.9 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:16436 Metric:1
RX packets:782 errors:0 dropped:0 overruns:0 frame:0
TX packets:782 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:55561 (54.2 Kb) TX bytes:55561 (54.2 Kb)
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.43.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
--
I am using 4.2.6 on OS X (10.7.5).
Guest OS: openSUSE 12.2 (x86_64).