Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically, I want to be able to connect to a wireless network from my laptop. Then, I want my virtual machine to acquire internet access via a bridged connection from ETH0 of the VM to the host’s primary wireless adapter.I have already successfully accomplished this much.

Now, I have eth1 configured as a DHCP server on the virtual machine (aka DEBIAN Router). Currently, I have this bridged to the physical 10/100 nic on my laptop (for now, Ill address the wifi part of this connection later). The NIC itself obtains IP from the VM, which is fine, i assume. I connected my netbook to the physical 10/100 port; it receives an IP address from ETH1 just fine, but fails to connect to the internet. I have ip forwarding enabled, but don't know how to route internet requests outside of the LAN the VM is hosting, to the WAN the laptops physical wifi nic is connected to.

I can access the virtual machines web server, but no resources outside of the virtual LAN. So this is where I am stuck. In the end, I want to configure a second wireless NIC on the Host machine as “virtual access point”, not ad-hoc. A client computer will see the virtual ap listed in wireless connections as a standard wireless router, connect to it, and be online. My ultimate goal is to set up traffic analyzing for any clients connected through the “virtual access point” by routing all wireless traffic connected to the second wifi nic, through the internet connection of the primary wireless connection on the host machine.

share|improve this question

Use the route command in your VM - eg, check out man route.

share|improve this answer

You need to set up ip masquerading.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.