I'm pretty sure I'm missing something very obvious here.
Sorry if this is a simple question, I'm brand new to this and I don't have much experience on it.
Hello @jow thank you for your help.
I tried to create a machine using your example and I have a couple of questions:
1 - What the difference between the image you're using ( openwrt-x86-64-generic-squashfs-combined.img) and the one that I have been using (openwrt-21.02.1-x86-64-generic-ext4-combined.img)?
2 - While configuring the network using your example, I'm getting an error at $ sudo iptables -t nat -I POSTROUTING -j MASQUERADING
All the rest goes fine, though. In the end I still can't ping anything or run a opkg update on openWRT.
Any other thoughts?
The squashfs one uses the rom filesystem + overlay approach you'll find on most OpenWrt supported devices, it can also be reset to its initial state. The ext4 image is fully writable and cannot be reset to defaults, afair it also requires manual repartitioning and ext4 resize to enlarge it while for the squashfs image it is enough to simply enlarge the image file (the truncate -s command above)
Yes, this was actually a typo since I wrote this from memory, it needs to be
The various iptables and sysctl commands will essentially turn your desktop into a very simple NAT router which masquerades and forwards all traffic from/to tap0 (the virtual NIC of your QEMU OpenWrt). There are more sophisticated ways to set that up but for quickly launching QEMU instances this is close to the simplest and shortest solution possible.
@jow All commands worked this time! used opkg update and worked fine!
For some reason my computer lost connection to the network but openWRT is still connected to the internet.
Any thoughts on why this is happening?