Multiple public IPs one NIC multiple VMs

Discussions related to using VirtualBox on Windows hosts.
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Multiple public IPs one NIC multiple VMs

Post by tip32a »

I would think this is fairly common. I currently have 4 physical servers each connected to its own router. Each router/fireWALL has a different public ip address. all connected to the same cable modem.


I want to virtualize each server in one box that only has 1 physical nic. Can I recreate the network spelled out above within VB?

thanks tom
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Multiple public IPs one NIC multiple VMs

Post by scottgus1 »

I think Bridged should be able to do this, see Virtualbox Networks: In Pictures: Bridged Adapter.

I am not certain how to assign multiple public IP addresses coming on one line from the ISP (connected through a switch?) to different routers. But each guest gets its own network card, and with Bridged all the guests' cards are 'attached to a switch' in the host's network card.

So you might be able to run the ISP's internet to the host PC, Bridge the guests to the host's network card, then set the public IP addresses, one on each guest's virtual network card. I would do some experiments before outlaying cash.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Multiple public IPs one NIC multiple VMs

Post by BillG »

Most physical networks can be emulated in virtual ones. How do the physical servers connect to their routers? Are they directly connected or are they on a switch?
Bill
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Re: Multiple public IPs one NIC multiple VMs

Post by tip32a »

Hi Bill G. Each Server's NIC is connected to port1 of the Router/firewall appliance. Don't see a need for additional switches. Being technical the fact that the router has 4 output ports means IT has an embedded switch. Does that answer your question?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Multiple public IPs one NIC multiple VMs

Post by scottgus1 »

tip32a wrote:Each Server's NIC is connected to port1 of the Router/firewall appliance
tip32a wrote: 4 physical servers each connected to its own router
Are there four separate routers or one router with four or more ports?

If there are four routers, what does each router connect to on the WAN side?

Perhaps a hand sketch, scanned or phone-camera-snapshotted, then posted with the forum's Upload Attachment tab would help.
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Re: Multiple public IPs one NIC multiple VMs

Post by tip32a »

Attached is a drawing for clarification. Hope this helps... I want to virtualize everything coming out of ports 1,2,3,4 of the cable modem.
Tried to attach the file. was warned it is too big had to be 2Mb shrank it to 1.85 MB and now warned it has to be small than 128KiB. so here it is...


Tom
Attachments
Network drawing
Network drawing
20200515_121314rerendered.jpg (43.55 KiB) Viewed 2124 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Multiple public IPs one NIC multiple VMs

Post by scottgus1 »

Sorry, the image is unreadable. There's too much gradient in the picture to compress well. You will have to try ASCII art or a sketch in Paint something else.
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Re: Multiple public IPs one NIC multiple VMs

Post by tip32a »

This is silly. You can see from left to right. On the left is the cloud. going to one BOX a coax cable modem. Then going to 4 routers, then each router goes to each server.

Each router sees a different public static ip x.y.z.50, x.y.z.51....

Each router out forwards ports 80 and 443 to their respective server. Each server is configured with a static private IP router 1 is, 192.168.10.5, router 2 is 192.168.0.5, router 3 is 10.10.0.5 and router 4 is 10.10.10.5.

I am aware that they do not have to be different ip addresses because they are isolated networks but that is how they are configured.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Multiple public IPs one NIC multiple VMs

Post by scottgus1 »

tip32a wrote:This is silly.
I'm not going to bother with you if you respond this way to my request for further information to help your problem. It's sillier to post a picture with unreadable text and expect others who are volunteering their time to understand your illegible chicken-scratch. Virtualbox is free. Solve your problem yourself. Or respond nicely when people ask you for further information.
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Re: Multiple public IPs one NIC multiple VMs

Post by tip32a »

I believe the attached is now readable and should make the answer to your question apparent. I am sorry that my descriptions were not enough I will endeavor to be more detailed in future posts. . I realize this is a free service and free application. I appreciate ALL the effort the creators put into it. I realize it is supported by volunteers I appreciate ALL of the volunteers spend their precious time responding to posts. But however is hosting the forum should also be aware that most programs do not save in KiB size. I have edited the file 2 dozen times and resized the dithering and resampled. all to attach the file.

If anyone can help it would be appreciated I have ordered a 4 PORT NIC from Dell it will be here in 2 weeks if all else fails.
Attachments
network.jpg
network.jpg (106.39 KiB) Viewed 2104 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Multiple public IPs one NIC multiple VMs

Post by scottgus1 »

Thanks for the picture, and all your effort to get it under the forum's size limit. It is a tight limit, yes, I asked for it to be increased once too, was told that the powers that be wouldn't do it. There's a reason, I don't remember what it is.

If all your network traffic came on one wire, then you could use Bridged to attach all four SVR#'s to the one network port and set the SVR#s' virtual network cards to the static IP addresses you want.

The four-wire-four-router set is something I don't know how to do, though. There will probably be VLANs involved to go down to one wire from the routers for the single-port host network card. BillG is the VLAN guru.

If the four ports from the cable modem are just a built-in switch, and you can program things in that modem to send all four ISP streams on one network port, then run the wire to the host's network card, you could run four router-OS guests to virtualize the physical routers (pfSense?) Bridged to the host's network card in the router guests' WAN sides, then four separate Internal networks to the four SVR guests.

If you want to keep the four routers and virtualize only the four SVRs, then you would need the four-port card, I think. Bridge each SVR guest to one port on the four-port card.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Multiple public IPs one NIC multiple VMs

Post by BillG »

Since the modem has four distinct ports, I can't see any way to do it without four NIC ports in the host PC, one for each modem port.

From there, I would install four virtual router appliances and bridge the public NIC of each router appliance to one of the host NICs. This public NIC would have the public IP.

The four virtual servers would connect to the private side of each virtual router using an internal virtual network.
Bill
tip32a
Posts: 12
Joined: 22. May 2019, 20:42

Re: Multiple public IPs one NIC multiple VMs

Post by tip32a »

Hi BillG, You say the modem has 4 distinct ports. Visually that is correct. but I could just as well come out of only 1 port to a switch then go to the 4 routers. For a matter of fact if I want to use my 5 th IP that is exactly what I would do. Disconnect one router connect a 5 port switch port 1 of switch to the now open modem port, port 2 to the fourth router and port 3 to a fifth router. I fail to see where the fact that 4 ports are bring used changes anything. Please elaborate on your answer.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Multiple public IPs one NIC multiple VMs

Post by fth0 »

I would physically connect one LAN port of the cable modem with the LAN port of your VirtualBox host. If you can configure your cable modem to use multiple IP networks on one LAN port (with or without VLANs), you can simply do that. Otherwise, define an IP network like 192.168.0.0/22 (which encompasses 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24 and 192.168.3.0/24). Then create several VMs with the Bridged Networking mode, and containing a router/firewall combination in the Guest OS to separate the wanted IP network from the others. Beware that this concept doesn't discuss security aspects so far.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Multiple public IPs one NIC multiple VMs

Post by BillG »

All of this really has very little to do with VirtualBox. Speculating on the possible capabilities of an unknown cable modem is not really what I think this forum is about. The manufacturer's documentation should tell you what the modem can or can't do.
Bill
Post Reply