I did install openWrt on QEMU, and now I want to create a virtual router, but in order to do this, we need both interfaces (LAN and WAN), my problem is that I can not create WAN as an interface, I tried to do it manually several times, but I don't even have it as an option. Anyone of you had the same issue and fixed it before?
How do you expect your wan and lan ports to work? There are multiple contexts for this:
- 1 physical network interface bound to your OpenWrt VM, both lan and wan on the same physical port using VLANs.
- 2 physical network interfaces bound to your OpenWrt VM, lan on one, wan on the other.
- 2 virtual interfaces bound to your OpenWrt VM, one for lan, one for wan.
we expect them to work on the 3rd context: 2 virtual interfaces bound to the OpenWrt VM, one for lan, one for wan.
In that case, you should be able to make lan eth0 and wan eth1 (or vice versa).
The openwrt side should be easy.
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:
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
That was so helpful! Thank you so much ^^
For the most part this is only a question of properly setting up your hypervisor (e.g. qemu-kvm), as long as OpenWrt gets handed over two+ (virtual-)network cards, it'll use the first one for lan and the second one for wan. How this is done depends a) on the hypervisor in question, b) on your policy decisions (tun, tap, some virtual switch, etc.) and c) on your host distribution, how it exposes these features as part of its packaging. And yes, there's also a d), namely what actual userspace package you're using to manage kvm, qemu, aqemu, qemu-system-gui, libvirt, openstack, and many more. There are plenty of potential ways to set this up, more than OpenWrt could cover.