Restricting internet access from guest?

This is for discussing general topics about how to use VirtualBox.
Post Reply
thegnark
Posts: 16
Joined: 18. Aug 2008, 16:31

Restricting internet access from guest?

Post by thegnark »

Hello,

I've installed VirtualBox with Host Networking, but would like to limit/restrict internet access from the guest (it should only access internal network devices). It needs to be accessible from other network devices (i.e. it exists as an application server), so NAT and Internal aren't feasible.

I thought of leaving the gateway setting empty, but some devices live on other subnets. Additionally, I have no control over network hardware to set an access restriction there.

Is there any other obvious solution that I try?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

There are some solutions. If you run Linux, you can create a TAP interface and use HIF with that. Then set forwarding on so your Host becomes a router for the Guest. Now set some IP table rules (see their website for more info) that only allows traffic from your Guest to the internal subnets. The rest is blocked with the source of your Guest. All other traffic is from your Host, so that needs to be allowed.

If you have Windows, then a firewall with similar functionality as Linux iptables is needed. See the VirtualBox FAQ for how to install the MS Loopback adapter.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply