1

I have a set-up like this:

           Ubuntu (Host OS)

OpenWRT(Guest OS) | Damn Small Linux(Guest OS)

OpenWRT is connected to Ubuntu through two interfaces, eth0 via NAT (for internet) and eth1 via Host-only adapter.

Damn Small Linux has one network adapter, the Host-only adapter which OpenWRT uses.

I would like Damn Small Linux to be able to access the internet through OpenWRT through the Host-only adapter.

Here is a crude drawing I did to try an illustrate the situation:

crude drawing

Is what I am trying to do possible? Can anybody run through a high level description of what is needed to make this work? I.e OpenWRT acts as a dhcp server for the Host-Only Adapter interface etc..

The idea is this, I am trying to emulate OpenWRT being a physical router connected to the internet on one interface (eth0) and providing internet on another (eth1 / the host-only adapter)

I would appreciate any thoughts or comments on this!

TomSelleck
  • 125
  • 1
  • 7

2 Answers2

2

Yes, that should work fine.

Some thoughts:

  • eth0 on Damn Small Linux VM must be a attached to the same Host-only network as eth1 on OpenWRT. Use the IP from eth1 on OpenWRT as your default Gateway.
  • I would use a bridged config for eth0 on OpenWRT rather than NAT. Assign it a unique IP on your host's network. This will prevent some complications and will also help emulate a physical router better.
  • Be sure to set up any necessary firewall rules or policies in OpenWRT. Also make sure your default outbound route is set correctly. If you're using bridged config your next hop is the Gateway for your host network - so all outbound traffic should be routed there.

Specifics:

OpenWRT:

  • eth0 (emulated WAN)
    • IP: unique IP from host network
    • Subnet Mask: same as SM from host network
    • Gateway: Same as GW from host network
  • eth1 (emulated LAN [host-only])
    • IP: unique IP from host-only network
    • Subnet Mask: depends on the host-only network, usually /24
    • Gateway: none (it's a router!)

Damn Small Linux:

  • eth0 (emulated LAN [host-only])
    • IP: unique IP from host-only network
    • Subnet Mask: depends on the host-only network, usually /24
    • Gateway: LAN IP of OpenWRT
jlehtinen
  • 1,958
  • 2
  • 13
  • 15
0

Theoretically it should be possible if you enable promiscuous mode on your host only network.

Where does Ubuntu fit into this whole picture ? It looks like, as far as the Ubuntu VM is concerned it's connected to just another port on the Host Only virtual switch.

Are you using VMware ? VBox? I believe you should be able to enable promiscuous mode on the Host only virtual switch.

Rico
  • 2,235
  • 19
  • 19