3 Guests on internal network, cant ping each other

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Tsso
Posts: 25
Joined: 9. Sep 2012, 19:32

3 Guests on internal network, cant ping each other

Post by Tsso »

heya,
Im trying to setup a virtual lab with VirtualBox, using 2 Ubuntu guests and 1 XP.
Each of the guests are attached to the VirtualBox internal network.

I have one of the Ubuntu Guests configured with 2 network adapters,
one adapter is connected to the internal network and the other is connected to the NAT.
I want all network traffic to pass through this guest.

I have each guest configured with a static IP, the gateway IP is set to the NATed guests internal network adapter IP.
I can get internet on each guest, and can see the traffic (using wireshark) going through my NATed Ubuntu system.

The problem I am having is I cant seem to ping or connect to any of the services running on the internal network. I just get the message 'connect: Network is unreachable',
Im guessing this has something to do with my routing table, which is empty, but not sure how to fix it.

Ive tried adding a route using: "route add 169.254.236.0/24 gw 169.254.236.100"
but i just get an error message: "netmask 000000ff doesn't make sense with host route"

My static IPs are set as follows:
auto eth0
iface eth0 inet static
address 169.254.236.201
netmask 255.255.0.0
network 169.254.236.0
broadcast 168.254.255.255
gateway 169.254.236.100
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: 3 Guests on internal network, cant ping each other

Post by BillG »

If they are all in the same network, adding static routes will make no difference. Routes are only used if the traffic is actually routed (ie sent to a different IP subnet). Machines in the same IP subnet use direct addressing and no router ever sees the traffic.

Why are you using APIPA (169.254.0.0/16) addresses? They are not routable. Use one of the reserved private network subnets. http://en.wikipedia.org/wiki/Private_network

If you want to use a 24-bit subnet mask use a 192.168.x.0/24 .Everything should be fine.eg

router
192.168.21.254/24
|
clients
192.168.21.x/24 dg 192.168.21.254

The APIPA addresses use a 16-bit netmask so that explains your error message if you are using 24-bit.
Bill
Tsso
Posts: 25
Joined: 9. Sep 2012, 19:32

Re: 3 Guests on internal network, cant ping each other

Post by Tsso »

I was using the 169.254.0.0 addresses because I was following a guide on routing internet through another guest.
So I switched to using 10.54 now my XP guest can access internet and ping both my ubuntu guests, but my non-nated ubuntu guest cant do either.
I dont get the 'Network is unreachable' message anymore, but it does time out.

Static IP is set as
auto eth0
iface eth0 inet static
address 10.54.236.201
netmask 255.255.0.0
network 10.54.236.0
broadcast 10.54.255.255
gateway 10.54.236.100
Route table shows
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.54.236.100 0.0.0.0 UG 100 0 0 eth0
10.54.0.0 * 255.255.0.0 U 0 0 0 eth0
Thanks
Tsso
Posts: 25
Joined: 9. Sep 2012, 19:32

Re: 3 Guests on internal network, cant ping each other

Post by Tsso »

ok, I think I got it working now.
I did away with setting static IPs, and installed a dhcp3 server to the Ubuntu guest, that I'm using as the router.

The router still wasn't forwarding packets back to the guest but after a little tinkering and reboots, it appears to be working.
I am now able to connect to a server running on the other guests. Yippie :)

Thanks
Post Reply