Problem with networking

Discussions related to using VirtualBox on Linux hosts.
Post Reply
karq
Posts: 2
Joined: 12. Mar 2014, 22:16

Problem with networking

Post by karq »

Here's my setup:

host: ubuntu server
guest: ipcop, ubuntuserver, windows xp

And here is my hosts network settings:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.254

# The secondary network interface
auto eth1
iface eth1 inet manual

When I connect my other pc to eth0 then I can access internet and ipcop but I cant access host machine anymore, How do I have to setup the host networking? I wanna route host traffic through ipcop.
dsherer
Posts: 57
Joined: 13. Mar 2014, 06:22

Re: Problem with networking

Post by dsherer »

If you are going to run through IPCOP you need one side to be an outside interface (i.e. from your ISP) and the other interface to be your internal network. If you are looking to use IPCOP as a router/firewall I wouid recommend using untagle or pfense or smoothwall as all of these do the same thing. Untangle it the most robust and user friendly IHO. It is free and comes with free web filtering, spam filtering, phishing, and a lot of others plus it is easy to set up.

However if you are trying to setup this scenario, for your homeI would not recomend using any

ISP Modem/Router -->Host Machine-->Virtual Machine (IPCOP Router)-->Second PC

I would not recomend using any virtual machine, not that a virtual machine won't work. The problem is that Home ISP services only gives you one Public IP Address and it is a DHCP address, grant it it the ip very rarely changes. So if you assign the host machine with the outside IP address (public) you would not be able to bridge your virtual machine to the host as you would need a public ip address for the VM for the bridging. The only option that leaves you with then is NATing which creats the problem of double NATing as you will be NATing' your Public IP then the router would be NATing that NAT'ed address and then NAT it again for your private network on the other NIC.

Let me try and draw a visual

let say your Outside IP is 98.223.169.252 and you assign that to NIC1 on you host. Now on your NIC1 on your Virtual Machine you set it for NAT. When you start up your VM it will give you a DHCP IP address that can be used to be NAT'ed to your Host NIC1 (it can also be set statically). The Second NIC on the host (NIC2) you would set to an IP address on your network then you would bridge your VM NIC2 to the Host NIC2. You would assign a IP address on your network to the VM NIC2

so you would have this

Public IP/Host NIC1 VM NIC1 (NAT) HOST NIC2 (Your Network Addressing) VM NIC2 Your PC
98.223.169.252 192.168.0.1 192.168.1.1 192.168.1.2 192.168.1.3

You can see from above the Double NAT. First NAT going from 98.223.169.252 to 192.168.0.1 the the second NAT going from 192.168.0.1 to 192.168.1.1
This will not work. you can look up double NAT'ing to see why.

With a program like Untangle you can bridge the two interfaces in the software, but you would still need another device to route and NAT the traffic from the Public IP to your Network.

This is why I would not recomend using a VM, another reason is that it leaves your Host Machine on a public IP and open to the Wild Wild Internet.

Using a physical Machine to accomplish this would be your best bet.

I just built an Untangle Box with Router/Firewall/Web Filter/Spam Filter/Phish Filter/Reports and it works very well check it out here

http://www.untangle.com/store/get-untangle/

IF you need more help PM me
Post Reply