turn my ebox guest into a router for a cable-modem conection

This is for discussing general topics about how to use VirtualBox.
Post Reply
fdelval
Posts: 9
Joined: 16. Dec 2010, 22:23
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: windows

turn my ebox guest into a router for a cable-modem conection

Post by fdelval »

Hello all!

As you know, cable-modem assign a public IP to the host connected, and you can only connect one host.
A solution is getting a router, which is what i did with an old PC, a linux distro, and some iptables work.

The old PC's fan is starting to fail, its noisy and i thought, what if i virtualize it? so i want to go further, and i want to keep my old-pc-as-router, but virtualized inside another PC of the LAN.

Before, lets write down the schema:

internetttttttttttttttttttt -> the pc with 2 interfaces and router virtualized inside -------------> switch ------> LAN

88.123.123.123 -------> router get that address in one interface, and 192.168.1.254 in the other, static address. ---> switch -------> LAN 192.168.1.x


Problems.
The HOST pc could have a 192.168.1.x address, and 192.168.1.254 as gateway. right? (Host PC is not a spare PC, its just another PC with me working on it)
The virtualized router inside should have 2 network adapters, which adapters? bridged? internal? NAT? H-O?

The guest should get via DHCP the leased ip from the cable-modem, but the host should have a static IP.
I dont know if that could work, so before spend a whole day testing and virtualizing, i prefer to confirm if its possible/it has been made before.

thank you
fdelval
Posts: 9
Joined: 16. Dec 2010, 22:23
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: windows

Re: turn my ebox guest into a router for a cable-modem conection

Post by fdelval »

no idea if its possible?

a hint?

I tryed to make a VM with BRIDGED interfaces, and no, guest didnt get the DHCP ip...
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: turn my ebox guest into a router for a cable-modem conection

Post by Martin »

This setup should be possible with bridged networking but you need to make sure that the host os doesn't configure and (iptables) filter the network adapters for the router VM.
fdelval
Posts: 9
Joined: 16. Dec 2010, 22:23
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: windows

Re: turn my ebox guest into a router for a cable-modem conection

Post by fdelval »

Hello!

I dont understand,
Host is windows, guest is linux; you suggest to redirect in host the DHCP signal to guest?
NeBlackCat
Posts: 154
Joined: 3. Aug 2008, 13:37

Re: turn my ebox guest into a router for a cable-modem conection

Post by NeBlackCat »

Assuming the PC has two physical NICs (Internet and LAN) you'd normally give the VM two corresponding virtual NICs, and bridge each to the corresponding physical one. The host then disappears out of the network picture completely, as the router VM effectively takes direct, total control of the physical NICs (if you want the host to be able to access the internet/LAN, you can give the router VM a third virtual "host only" NIC, and the host will then do its networking through the router VM just like the LAN clients do).

Inside the router VM:

1) the "Internet" virtual NIC should be set to use DHCP - it will get the public IP address from your side of the cable modem.

2) there should be a DHCP server, bound only to the "LAN" virtual NIC (and optional, third, host-only NIC if you want to involve the host in the network as well).

3) you should also do your firewalling there. The host can't, as it doesn't have access to the physical Internet NIC any more.

I did the opposite of your setup - Linux host, with Windows Server and Microsoft ISA Server (very good firewall/router/bandwidth controller) in the VM. Worked like a charm.
Post Reply