OpenWRT on Virtual Machine - unable to ping IP addresses or access LuCi

Network noob here. I can provide more information, but please Keep It Simple, for I am Stupid

I have installed OpenWRT on a virtual machine in VirtualBox, thanks to the helpful guide https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm

However, I am unable to connect to the router ("Unable to connect")

ping 192.168.56.2 gets results, but 192.168.56.3 gets me nowhere

opkg update is able to run

VirtualBox configuration:




ip addr

/etc/config/network:

uci show network

Ubuntu terminal output (thank you OpenWRT IRC):

Any help would be greatly appreciated please. Thank you for looking through my copious screenshots

Then why do you make it that complicated?

Please post all your configs as text. Sure the vBox gui is an exception but everything else as text, please.

And please dont remove/redact information. Public IPs maybe, but your are not edward snowden so no fukking need to redact MAC or ip neighbor information!

Regarding you issue:
How do you setup the vbox network?
What do you want to do in the end?
Why do you even try to use vbox for it? sure its nice for one shoot test by virtualbox is nowhere near any solution where you want to have your (vm) router running reliable. (yes i know some dump shits too who try this but its only pain and suffering. if you want a reliable router vm, then choose something with kvm under the hood which is also build for long time running VMs)
(sorry for the rant :/)

PS: And virtualbox is known to be have funky networks. You need to do more or less everything manually if you want a somehow functional network. VirtualBox does so many "magic happens here" within the network stack, its such a source of frustration.

What is the purpose of the lan interface? That looks incorrect for several reasons -- DHCP protocol (that's DHCP client), but overlapping subnet as your mng interface, and no subnet mask.

Adapter 1 is eth0
2 is eth1
And so on - it seems that's OK, because you pinged something you configured in VirtualBox (not sure why or the use case yet).

What machine is addressed 192.168.56.3?

You never told us.

Thank you all

My aim is to set up a router that isn't spying on me - be it Big Brother or Big Tech - so an open-source operating system for a router that I can then install a VPN onto is a big win. OpenWRT was recommended :slight_smile:
I am overcomplicating things because I have no idea what I'm doing! :rofl:
(more seriously, if there is a simpler way to do things, I'm happy to be told how!)

IPv4 Address: 192.168.56.1
IPv4 Network Mask: 255.255.255.0
IPv6 Address: fe80::800:27ff:fe00:0
IPv6 Prefix Length: 64

mng ipaddr 192.168.56.2
lan ipaddr 192.168.56.3

[rant away; I do not mind]

As I stated earlier, you must not have the same or overlapping subnets on additional interfaces.

It seems that you actually have the same subnet on the wan, too, if that is what this is:

If the above is actually the wan address, you must have different subnets on your lan and mng interfaces.

So, for example, your router's address on mng could be 192.168.17.1, and your lan address could be 192.168.63.1.

Got it, thank you

IPv4 Address: 192.168.56.1
IPv4 Network Mask: 255.255.255.0

mng ipaddr 192.168.55.2
lan ipaddr 192.168.54.3

I now get connection timeouts in my host machine's browser when attempting to connect to the mng or lan addresses

There are two parts to this -- one is the OpenWrt config, the other is the virtual environment.

OpenWrt side we can help you here... let's see your latest complete config:

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/dhcp
cat /etc/config/firewall

Please be sure to post the above as text, not images.

On the virtual environment side, see the documentation here:
https://openwrt.org/docs/guide-user/virtualization/start

Most of the network config on the host/VM manager is out of scope for this forum.

I have attempted to
ssh root@192.168.1.1
on my host machine's command prompt, but I get
ssh: connect to host 192.168.1.1 port 22: Connection refused

If I run this in OpenWRT SSH, I get
ssh: Connect to root@192.168.1.1:22 exited: Connect failed: Connection refused

sssh root@ for other IP addresses that I have seen yield the same Connection Refused error
Happy to be told if this is VirtualBox rather than OpenWRT

  • How did you setup VirtualBox?
  • What device, machine or host have you initiated ping from?
  • How did you setup the device?

We can't guess why you cannot ping your own machine.

Most importantly, how did you configure the host machine's network and how did you set it up to use the OpenWrt VM's LAN?

:spiral_notepad: (It requires manual configuration.)

Assuming you have two physical Ethernet ports in the host PC (it is hard to build a router without separate "in" and "out" ports)-- the simplest setup is to make a bridge for each one in the hypervisor. One is the link to the untrusted network leading to the Internet, and the other one links to your trusted network on the LAN side of OpenWrt. After OpenWrt is routing packets, you can reconfigure the host OS to use the LAN bridge as its network connection, so it has safe routing to the Internet through OpenWrt, and direct access to other hardware connected to that port.

A Host Only Network is merely a bridge that has no physical port. It can only be reached by the host itself and other VMs running on the same host. This is what to use if you only have one Ethernet port.

Note that the numbering of Virtual Box's virtual eth ports is not certain to align with the guest (OpenWrt kernel) enumeration of eth0 eth1 etc. You may need some trial and error to find which one is which. It should not change after that though as long as you don't add or remove anything.