A bridge providing firewall capabilities

Discussions about using Linux guests in VirtualBox.
Post Reply
kpb
Posts: 1
Joined: 5. Mar 2014, 23:06

A bridge providing firewall capabilities

Post by kpb »

Hi,

I have a setup with two vm guests (guest1 and guest2) both running Debian. I'm trying to route all traffic from guest2 through guest1 but I can't get it to work. The setup at the moment is as follows:
Internet/host ---- router (10.70.2.1) ---- guest1 (10.70.2.253)
                                              |
                                              |---- guest2 (10.70.2.7 gw 10.70.2.1)
guest1 has two network adapters: nat network on adapter 1 and internal network on apdapter 2.
my etc/network/interfaces looks like this:
---------------------------------------
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
address 10.70.2.253
netmask 255.255.255.0
network 10.70.2.0
broadcast 10.70.2.255

pre-up /sbin/ip link set eth0 up
pre-up /sbin/ip link set eth1 up
pre-up /sbin/brctl addbr br0
pre-up /sbin/brctl addif br0 eth0
pre-up /sbin/brctl addif br0 eth1

pre-down /sbin/brctl delif br0 eth0
pre-down /sbin/ip link set eth0 down
pre-down /sbin/brctl delif br0 eth1
pre-down /sbin/ip link set eth1 down
-----------------------------------------------------------------
also I have added the following line to the route table: sudo route add default gw 10.70.2.1 br0

guest2 has one network adapter running as internal network.
the /etc/network/interfaces file on this guest looks like this:
-------------------------------------
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.70.2.7
netmask 255.255.255.0
network 10.70.2.0
gateway 10.70.2.1
---------------------------------------

The problem is that I can't get any connection between guest1 and guest 2 and I have know idea on how to fix this. All this network configuration is quite new to me, so it might be that what i'm trying to do is not possible at all..
Post Reply