Page 1 of 1

Using firewall in ubuntu guest

Posted: 8. Feb 2013, 14:15
by DTom
Hi,

I have windows 7 pro host with ubuntu server 12.10 as guest. The host has a static ip. The networking mode is NAT with port forwarding from host port 22 to guest port 22. I don't want to use use bridged networking because of company policies.

I need to ssh (port: 22) into the guest from the internet and I want to limit inbound connections to guest port 22 to certain ip addresses. So I enabled ufw in the guest and added rules to it. When I try to ssh into the guest from one of the allowed ip addresses, it's not connecting. If I disable ufw, it works.

What could be wrong? I don't know much about NAT and guest firewalls.

Thanks in advance for your response.

Re: Using firewall in ubuntu guest

Posted: 8. Feb 2013, 16:45
by noteirak
If you say that it works without ufw, then there is nothing wrong with Virtualbox, and this is the wrong place to post your issue.
We only support Virtualbox-related issues, so the best would be to post on a networking, linux or security forum.

Re: Using firewall in ubuntu guest

Posted: 8. Feb 2013, 16:46
by DTom
I found the problem. The guest always receives the ip: 10.0.2.2 no matter who connects to it. I disabled firewall on the guest added the same ip restriction rules to the virtualbox entry in the host windows firewall and it worked. My question is if I install a web server in the guest, won't it be able to detect the actual ip address of the client who's connecting to it?

Re: Using firewall in ubuntu guest

Posted: 8. Feb 2013, 16:53
by noteirak
No you won't, that is how the NAT mode works: The virtualbox engine acts like a proxy, the host or the guest (or anything around them) will never know where it came from or to.