Static IP setup issues

Discussions related to using VirtualBox on Windows hosts.
Post Reply
RunWild
Posts: 7
Joined: 19. Feb 2015, 19:28
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu

Static IP setup issues

Post by RunWild »

I am running a Windows 7 Pro host machine with VB 5.1.30

My VB pref HOST-ONLY network settings are:

Code: Select all

IPv4 addr: 192.168.200.1
IPv4 NM: 255.255.255.0
DHCP is DISABLED
I have 2 Ubuntu guest servers, one is a webserver the other is a database server.
I want to be able to communicate from the host to either guest and between each guest.
I also want each guest to have access to the internet (but NOT internet to guest).
All examples I have seen say I need 2 adapters: a NAT adapter and a HOST-ONLY adapter.

The NAT adapter settings are defaults except for port forwarding for SSH from host to guest.
The HOST-ONLY adapter is also defaults.

The "interfaces" file on both guests is identical except for the static IP address of each:

Code: Select all

# ---------- start of file
auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
address 192.168.200.xx
netmask 255.255.255.0
# ---------- end of file
When I do "ifconfig" on either guest I get (except IP address is what I set them to in "interfaces"):

Code: Select all

enp0s3   Link encap:Ethernet  HWaddr 08:00:27:8d:8d:54
             inet addr:192.168.200.xx  Bcast:192.168.200.255  Mask:255.255.255.0
             inet6 addr: fe80::a00:27ff:fe8d:8d54/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             ...

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
             ...
The problems are as follows:
I cannot SSH to either guest from the host.
I cannot ping the other guest from either guest ... "Destination Host Unreachable"
I also cannot access the internet from either guest.

Can anyone see if a setting is causing the issues?

Any suggestions would be appreciated.

Thanks
Last edited by socratis on 23. Nov 2017, 03:11, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
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: Static IP setup issues

Post by BillG »

That looks fine to me. I don't have a Linux guest, but with Windows7/8.1 as guests that setup works fine. Both guests can ping to and from the host. They can also ping each other if the internal firewalls are modified. (I simply turned them off for testing).
Bill
RunWild
Posts: 7
Joined: 19. Feb 2015, 19:28
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Static IP setup issues

Post by RunWild »

Thanks for the edit socratis.
Thanks for response BillG.
I am still at a complete loss here. :roll:
It wouldn't surprise me if it's a really small thing that's not set correctly.
By the way, there are NO firewalls involved here at all.

Thanks
RunWild
Posts: 7
Joined: 19. Feb 2015, 19:28
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Static IP setup issues

Post by RunWild »

What's also weird is this:
I made the "interfaces" for "enp0s3" both dhcp.
I made the VB pref host-only dhcp enabled with the following:

Code: Select all

Server Address: 192.168.200.2
Server Mask: 255.255.255.0
Lower ... : 192.168.200.101
Upper ... : 192.168.200.150
After rebooting both guests and doing "ifconfig" they give exactly the same result

Code: Select all

inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
Something is obviously very wrong since the IPs are (1) identical and (2) aren't in the range I wanted.

:x
RunWild
Posts: 7
Joined: 19. Feb 2015, 19:28
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Static IP setup issues

Post by RunWild »

Some more information ...

I found this viewtopic.php?f=6&t=57266#p265735 post. I have exactly the same symptoms on my Win 7 host. Nothing I do corrects the problem.
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: Static IP setup issues

Post by BillG »

10.0.2.15 Is a NAT address. Are you sure that you looked at the right adapter? And they should not be the same. My guess is that these two vms are clones and the NICs have the same MAC address in both vms.

Shutdown both vms. From the VirtualBox manager, go to the Settings for one vm and in the network section click Advanced then click the icon to change the MAC address for both NICS of that vm. Now restart the vms and see what happens.
Bill
Post Reply