Page 1 of 2

Bridged Networking using Static IPs

Posted: 17. Sep 2010, 23:22
by tjk925
Here's the situation:

I have two network adapters installed on a Windows 7 Ultimate 64-bit host machine. I am running VirtualBox 3.2.8 with a CentOS 5.5 (32-bit) VM that I would like to use as a web server with FTP, SSH/SFTP and HTTP access. This is all set up fine on the CentOS guest, and using DHCP on my own home network, it all works swell. The second physical NIC (the bridged adapter in VirtualBox; not sure if I even need a second one with what I am doing) gets assigned some 192.168.2.x and the guest OS gets assigned some 192.168.2.x address by DHCP. I have internet access on the guest and can ping back and forth between the host and guest machines, and other machines on the network can access all the aforementioned services running on the guest OS.

There are no 3rd party firewalls in this set up. Just the Windows firewall with default config., MS Security Essentials (no firewall) and the firewall on the Linux guest OS with FTP, SSH and HTTP allowed through.

Now, I am trying to move this set up to an environment where I cannot use DHCP, but only static IP assignments (not using internally assigned IPs). I have tried using the same method whereby I set the second NIC as the bridged adapter in VBox, assign it some static IP (let's say 192.168.1.2) in Windows and assign some other static IP (192.168.1.3) in CentOS. However, this does not work. I do not have internet access on the guest OS. Furthermore, only the host OS can actually ping the guest OS and access the services it is running (and likewise from the guest to the host). No other machine on the same subnet (for example, another physical machine with 192.168.1.4) can ping it or otherwise.

I've read everything from cloning the MAC address from the host NIC to bridging the host NIC and VBox adapter and using the host-only adapter. I am still really confused at this point what hardware I need at minimum and what method to use in VirtualBox to get this to work and be accessible from the rest of the network. Appreciate any help.

Re: Bridged Networking using Static IPs

Posted: 17. Sep 2010, 23:32
by Sasquatch
It would help if you read chapter 6 - Virtual Networking of the User Manual, so you know what each adapter setting provides.
While you're at it, read the Forum Posting Guide too, as we are missing vital information VM settings and your network environment (where are the first and second adapter hooked on to on the Host).

Re: Bridged Networking using Static IPs

Posted: 17. Sep 2010, 23:46
by tjk925
Actually, I did read that chapter, and neither bridged adapter or host-only methods of doing what I stated have worked so far. So, if I thought it would work using one of the types and it didn't, that is where I am confused. I understand on basic terms how each method allows different types of connectivity.

This just seems like a common issue, where someone wants to host a web server and has multiple static IPs which they are assigned. But yet, I cannot seem to get it to work in my case.

And, I don't understand what you mean by where the adapters are hooked on to? They are just 2 1Gb/s ports (both on the motherboard).

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 00:01
by Sasquatch
Still need the VM settings and your physical network layout. You say you have two network adapters, where do they lead to? What network is it connected to? Do you use both, or only one? There is so much information missing, we can't help you at this time with what you gave us.

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 00:23
by tjk925
Well, I will say it is for a university department that wants to virtualize* some of its servers. We are allocated a certain range of IP addresses (I don't think I can list the range here) that are public and have been assigned to the university.

These adapters are both connected to the campus network (they lead to a network switch within the department). They are both in use; both have static IP assignments that are in the range allocated to our department by computing services. The DNS servers are entered statically as well and serve the entire campus.

I can, however, disable the first adapter with no change in stated behavior, so I don't even know that it's relevant now that I listed it as having 2 physical adapters.

And here is the showvminfo:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage showvminfo "CentOS"
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

Name:            CentOS
Guest OS:        Red Hat
UUID:            14eb486c-85f9-4fe3-8dd1-41d8d4aef0fb
Config file:     C:\VMs\VirtualBox\Machines\CentOS\CentOS.xml
Hardware UUID:   14eb486c-85f9-4fe3-8dd1-41d8d4aef0fb
Memory size:     1024MB
Page Fusion:     off
VRAM size:       32MB
HPET:            off
Number of CPUs:  1
Synthetic Cpu:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
PAE:             on
Time offset:     0 ms
RTC:             UTC
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
State:           running (since 2010-09-17T21:59:33.959000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0):            IDE Controller
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Name (1):            SATA Controller
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      3
IDE Controller (1, 0): Empty
SATA Controller (0, 0): C:\VMs\VirtualBox\HardDisks\CentOSroot.vdi (UUID: 8667d7
84-7c86-450a-84d9-0f31a2360dad)
SATA Controller (1, 0): C:\VMs\VirtualBox\HardDisks\CentOShome.vdi (UUID: a569c7
fe-6766-47fb-8166-6f24947b2f10)
SATA Controller (2, 0): C:\VMs\VirtualBox\HardDisks\CentOSswap.vdi (UUID: f5c5a7
db-1e2b-44fc-8bdb-602b54eec70b)
NIC 1:           MAC: 0800275747C1, Attachment: Bridged Interface 'Intel(R) 8256
6DM-2 Gigabit Network Connection', Cable connected: on, Trace: off (file: none),
 Type: 82545EM, Reported speed: 0 Mbps, Boot priority: 0
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
Audio:           disabled
Clipboard Mode:  Bidirectional
Video mode:      1040x733x32
VRDP:            disabled
USB:             enabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Shared folders:  <none>

VRDP Connection:    not active
Clients so far:     0

Guest:

OS type:                             Linux26
Additions active:                    yes
Configured memory balloon size:      0 MB
Is there a whole lot more I would need to provide?

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 03:11
by Will94
tjk925 and I work together. I just logged on to ask the same essential question as we were working on this in parallel much of the day.

I have a Windows Vista x86 host running VirtualBox 3.2.8. My static IP address is 128.194.112.xxx. I want to run a SuSE Linux Enterprise Server 10 SP3 virtual host, also with a fixed IP address. I installed a second network adapter in my PC in order to handle the network traffic for this virtual host. The IP address for this virtual host is 128.194.113.xxx. I have bridged my second network adapter with my VirtualBox Host-Only Network adapter in Windows on my PC.

I've tried assigning the virtual host's IP address to this bridge and setting the adapter in Linux to DHCP using both the bridged-adapter and host-only adapter settings in VirtualBox. This produces a virtual linux machine that cannot ping anything. My host PC can ping the 128.194.113.xxx address but no other machines can. I think that it's pinging the adapter as configured in Windows and not the linux virtual machine.

I've also tried assigning the 128.194.113.xxx IP address to the adapter on the virtual machine and setting the bridge in Windows to DHCP. This produces a virtual machine that cannot ping anything with an address that cannot be pinged by anything including the host PC. This is the case with VirtualBox's networking set to both the bridged-adapter and the host-only adapter.

I spent a good chunk of today troubleshooting this with only one, apparent, breakthrough. I read somewhere that the MAC address on the virtual adapter should be set to the actual MAC address of the physical adapter with which it is bridged on the host. I tried this, and it made no difference to the above results.

My question is how should I configure this for the virtual linux machine to have a fixed IP address and be visible to the world (ignoring obvious firewall issues)?

Thank you in advance.

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 03:24
by Perryg
Golly guys. This is all messed up.

Will94.
If you use host-only you will not be able to go any where as it is host-only. The networks are not in the same address scheme so they will not see each other unless you have a router and configure it accordingly.

tjk925.
PM me with the network information and we can keep this private but at some point I am going to need to know the addresses and that they match.
Do you two work for this university or is this a project that you are working on?
More than likely I will not get back to you tonight as it is late where I am but first thing in the am I will look this over. Please be specific and give any information that you think I will need to sort this out. Better to have too much than not enough.
I need to know your objective and what you expect when it is active.

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 03:37
by tombrdfrd66
I'm tearing my hair over a similar problem.

The host is Zentyal 2.0, which is a Gateway distro based on Ubuntu Server 10.4. The guest is RouterOS, a Linux-based networking/routing OS. The Machine is an IBM Blade server with three physical NIC's.

I want to give the OS guest bridged access to two of the three NICs and have a host-only network to the host.

I'm utterly foxed by the problem of matching the three virtual network adaptors in the guest to the three physical and one virtual adaptors in the machine.

The VB manual says: "To enable bridged networking, all you need to do is to open the Settings dialog of a virtual machine, go to the “Network” page and select “Bridged network” in the drop down list for the “Attached to” ?eld. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems."

But no-where anywhere on the "network page" for the selected adaptor can I see a list of host interfaces, desired or otherwise. All I get is, under 'Advanced', the virtualised adaptor type, its MAC address and the fact it's connected.

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 04:40
by BillG
tjk925 wrote:Well, I will say it is for a university department that wants to virtualize* some of its servers. We are allocated a certain range of IP addresses (I don't think I can list the range here) that are public and have been assigned to the university.

These adapters are both connected to the campus network (they lead to a network switch within the department). They are both in use; both have static IP assignments that are in the range allocated to our department by computing services. The DNS servers are entered statically as well and serve the entire campus.

I can, however, disable the first adapter with no change in stated behavior, so I don't even know that it's relevant now that I listed it as having 2 physical adapters.

And here is the showvminfo:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage showvminfo "CentOS"
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

Name:            CentOS
Guest OS:        Red Hat
UUID:            14eb486c-85f9-4fe3-8dd1-41d8d4aef0fb
Config file:     C:\VMs\VirtualBox\Machines\CentOS\CentOS.xml
Hardware UUID:   14eb486c-85f9-4fe3-8dd1-41d8d4aef0fb
Memory size:     1024MB
Page Fusion:     off
VRAM size:       32MB
HPET:            off
Number of CPUs:  1
Synthetic Cpu:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
PAE:             on
Time offset:     0 ms
RTC:             UTC
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
State:           running (since 2010-09-17T21:59:33.959000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0):            IDE Controller
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Name (1):            SATA Controller
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      3
IDE Controller (1, 0): Empty
SATA Controller (0, 0): C:\VMs\VirtualBox\HardDisks\CentOSroot.vdi (UUID: 8667d7
84-7c86-450a-84d9-0f31a2360dad)
SATA Controller (1, 0): C:\VMs\VirtualBox\HardDisks\CentOShome.vdi (UUID: a569c7
fe-6766-47fb-8166-6f24947b2f10)
SATA Controller (2, 0): C:\VMs\VirtualBox\HardDisks\CentOSswap.vdi (UUID: f5c5a7
db-1e2b-44fc-8bdb-602b54eec70b)
NIC 1:           MAC: 0800275747C1, Attachment: Bridged Interface 'Intel(R) 8256
6DM-2 Gigabit Network Connection', Cable connected: on, Trace: off (file: none),
 Type: 82545EM, Reported speed: 0 Mbps, Boot priority: 0
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
Audio:           disabled
Clipboard Mode:  Bidirectional
Video mode:      1040x733x32
VRDP:            disabled
USB:             enabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Shared folders:  <none>

VRDP Connection:    not active
Clients so far:     0

Guest:

OS type:                             Linux26
Additions active:                    yes
Configured memory balloon size:      0 MB
Is there a whole lot more I would need to provide?
OK. You do not need two NICs in the host. When you bridge a physical NIC to a virtual network, a filter driver is added to the host OS. This filter driver works with the NIC driver to separate the traffic addressed to the vm from the traffic addressed to the host. Each machine, physical or virtual, has its own MAC address and its own IP address. You can see from this that the firewall settings in the host have no effect on the vm. The host never sees the traffic going to the vm.

If you do have two NICs in the host, I would recommend dedicating one NIC to the host an one to the guest. You do this from the NIC properties in the Windows OS on the host. See this discussion from this forum. (This setup also avoids problems which can arise with some switches which only allow one MAC address per port.)

http://forums.virtualbox.org/viewtopic.php?f=6&t=34404

With this setup, each machine looks like a separate machine on the physical LAN. You give each machine its own public IP from your address pool. Each should be configured just like any other machine on the physical LAN. All settings should be identical except for the last octet of the IP address.

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 05:00
by tjk925
Okay, I think we understand more fully what we are dealing with at this point. We will both continue to test our respective VMs and report back on whether or not we were able to establish connectivity.

An issue that I was previously unaware of has to do with there potentially being an internal restriction imposed by our own computer services organization. That is, one MAC address per physical network port. In that case, the information that BillG is referencing has the solution we are looking for. What we need to do is go into the adapter's networking properties and un-check everything except "VirtualBox Bridged Networking Driver." Then we need to statically assign the IP in the guest OS as normal, using the Bridged Adapter mode with the second NIC set in VirtualBox.

Thanks all for assisting us in this matter, especially Perryg and BillG (and Sasquatch :) ).

Re: Bridged Networking using Static IPs

Posted: 18. Sep 2010, 23:44
by Sasquatch
tombrdfrd66 wrote:I'm tearing my hair over a similar problem.

The host is Zentyal 2.0, which is a Gateway distro based on Ubuntu Server 10.4. The guest is RouterOS, a Linux-based networking/routing OS. The Machine is an IBM Blade server with three physical NIC's.

I want to give the OS guest bridged access to two of the three NICs and have a host-only network to the host.

I'm utterly foxed by the problem of matching the three virtual network adaptors in the guest to the three physical and one virtual adaptors in the machine.

The VB manual says: "To enable bridged networking, all you need to do is to open the Settings dialog of a virtual machine, go to the “Network” page and select “Bridged network” in the drop down list for the “Attached to” ?eld. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems."

But no-where anywhere on the "network page" for the selected adaptor can I see a list of host interfaces, desired or otherwise. All I get is, under 'Advanced', the virtualised adaptor type, its MAC address and the fact it's connected.
Please open a separate topic for this. We don't want others to hijack a topic only because they have a similar issue, but are not part of the environment that is currently discussed.

@tjk925,
Before you disable settings on the second NIC, you have to make sure that the NIC is not used for anything, so verify that it does not have any IP configuration. Disabling the NIC might not pose any negative results directly on the Host itself, but there might be services running on that NIC alone which will then be inaccessible. If these services cannot be moved to another NIC and you can't add another physical NIC to the VM, you have to ask the network admin to disable port security on the port(s) that are connected to the server on the switch so that the port does not shut down when it detects more than one MAC address.

Re: Bridged Networking using Static IPs

Posted: 24. Nov 2015, 17:44
by stefana
Hi,
If i use a manual ip address for a bridged connection i also cannot use internet.
If i use dhcp for a bridged connection it works.
Destination Port Unreachable is what i get if i try to ping something on the internet.
So is it actually possible to use a bridged connection with a manual ip address?

Re: Bridged Networking using Static IPs

Posted: 24. Nov 2015, 17:57
by mpack
stefana wrote:So is it actually possible to use a bridged connection with a manual ip address?
Of course it is. It makes no difference to VirtualBox if your IP address is statically assigned or assigned by a router DHCP service. Of course, the whole point of an automatically configured IP address is that the selected address is guaranteed to be compatible with the network (e.g. correct address range, no conflicts). If you choose to statically assign an IP address then that checking is up to you.

Re: Bridged Networking using Static IPs

Posted: 24. Nov 2015, 18:23
by stefana
I am also not an expert in networking.
ON my host i use an ip scanner->With that scanner i see that the assigned ip by the dhcp server tot the virtual machine is "a certain ip address". So what i did afterwards is changing the bridged interface from dhcp to manual fixed ip with a valid ip "a certain ip adress" that was assigned before by the dhcp.
So i dont understand why the ip works when its assigned by dhcp and doesnt work when i put it in manual.
The only difference is maybe that i fill in for subnetmask 255.255.255.0 and for gateway i give in my router ip(the same ip address but with 1 at the end).

Re: Bridged Networking using Static IPs

Posted: 24. Nov 2015, 18:45
by scottgus1
If I recall correctly, when you put in a manual or static IP address on a Virtualbox Bridged network, you also have to manually type in the subnet mask and the default gateway address. For the average user the mask and gateway should be the same as what DHCP would set them. I do this all the time and get internet access in the guests.