How to connect guest VMs to OpenWrt also running as a guest VM

Hi there,

I'm just curious, and here's the idea I'm playing with:

  • I installed OpenWrt as a VirtualBox guest VM on host A
  • I have a guest operating system (let's name it guest A) on host A
  • I have another guest operating system (let's name this guest B) on host B
  • Hosts A and B are on the same physical LAN segment

So what I would like to know are:

  • What should be the network configuration of guest A to connect it to the virtual OpenWrt as its LAN? I tried both internal networking and host-only but guest A keeps on saying the connection failed (both for dynamic and static IP configuration).
  • Is it possible to connect guest B to the virtual OpenWrt in host A as its LAN? If yes, can anyone advise on how to do this?

Anyone know if this is possible?

Well... the way i'd approach it would be ( sorry I'm not sure I fully 'got' your setup so this is just a general topology for these kind of setups )

  • Host ... ( Leave it dhcp on your 'normal lan' )
  • Openwrt [nic0:lan-192.168.1.1:vmnet0] [nic1:wan-bridged:hostnic0]
  • VM-Client nic0:dhcp:vmnet0

( this assumes your regular lan does not use 192.168.1.x )
( vmnet0 is internal network with no dhcp from VirtualBox )
( vmnet0 / intnet should be similar? )

This topology would suit well if you;
a) only have virtual clients
b) do not need to access the lan side of the router from your 'host'

( which I think is what you have described in your post )

1 Like

I think you mean't to say...;

"can I connect a guestB-on-vmhostB to the internal network (or similar) on vmhostA"

Yes, you can... but it's not super easy with the above suggested topology. Some methods for this are;

  • gretap to 'br1' between hostA and hostB
  • almost the same as above but using openvswitch
  • use a second physical nic / link between HostA/HostB
  • use a vpn on openwrt-wan... bridge guestB and connect via vpn

and the list goes on...

all of this stuff is more general virtualbox usage... so I encourage you to track down some guides on these principles on the broader internet / virtualbox support channels...

2 Likes

Thanks again @anon50098793. I think your translation of my question is better than how I asked it. :rofl:

I'll look into gretap and openvswitch per your suggestion. Greatly appreciate your input. :+1: