Page 1 of 1

Shorewall Port Forwarding vs Host-only Adapter

Posted: 16. May 2013, 09:35
by dragosc
Hey guys, please follow the configuration bellow:

Ubuntu 1;
Ubuntu Server OS, running VirtualBox Server, on which is hosted

Ubuntu 2:
Ubuntu Server OS, configured with two network interfaces:
eth0 => Host Only Addapter
eth1 => NAT

Ubuntu 2 /etc/network/interfaces looks like this:

Code: Select all

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.56.100
        netmask 255.255.255.0
        network 192.168.56.0
        broadcast 192.168.56.255
auto eth1
iface eth1 inet dhcp
while Ubuntu 1's shorewall rules look like this:
/etc/shorewall/interfaces:

Code: Select all

###############################################################################
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     eth0            detect dhcp,tcpflags,routefilter,nosmurfs,routeback
vpn     tun0            detect
loc     vboxnet+        detect tcpflags,routefilter,nosmurfs,routeback
/etc/shorewall/rules

Code: Select all

####################################################################################################################################################
#ACTION         SOURCE          DEST            PROTO   DEST    SOURCE          ORIGINAL        RATE            USER/   MARK    CONNLIMIT       TIME
DNAT           net     loc:192.168.56.100      udp     36603
DNAT           net     loc:192.168.56.100      tcp     36603
This is a port forward, which tells the firewall to send everything that received on Ubuntu 1 to Ubuntu 2, which it totally does. tcpdump on Ubuntu 2 tells me I'm receiving the packages.
Problem is that, I can't see any communication backwards.

I'm using this to store logs using Syslog NG, and obviously it doesn't work because of this problem. I'm missing something and I don't know what.

Any kind of help is more than appreciated.

I can give you any kind of details about the system, unfortunately I can't give access.

Re: Shorewall Port Forwarding vs Host-only Adapter

Posted: 16. May 2013, 14:53
by noteirak
How is this actually related to Virtualbox? It only looks like an OS/firewall/networking config issue to me.

Re: Shorewall Port Forwarding vs Host-only Adapter

Posted: 20. May 2013, 11:58
by dragosc
I haven't been able to forward ports over VirtualBox's Network Host Only Addapter. Is it even possible?

On NAT Adapter, I have options for port forwarding, which means that VBox kinda handles forwarding by itself.

Re: Shorewall Port Forwarding vs Host-only Adapter

Posted: 20. May 2013, 12:32
by noteirak
Host-Only modes emulate a switch between your host and any VM attached to that particular host-only interface. So the host and the guest have their own IPs, and there is no need for port forwarding, simply use the guest/host IP.
You will have to handle firewalling issues.