OpenWrt Virtual Testbed?

I tried the docker image openwrtorg/rootfs in GNS3. It seems to work, but don't forget to add /etc/config (or maybe /etc) to the directories that are saved by GNS3.

2 Likes

I've not used GNS3 in a long, long time. I remember being able to run Cisco cIOS images on it though. It's a great sandbox. Wonder if a How-To on setting up a testbed like that would be worth someone doing.. peer @mikma :laughing: :blush: :+1:

1 Like

Thanks @Grommish and @mikma. It looks like people would prefer gns3. I have no idea of it, but if I get it running, I think I will upload my project somewhere. :slight_smile:

Do I have to add for each GNS3 OpenWrt-Router Instance a new virtualbox VM?

If you use the openwrt appliance template that's included in gns3 then it will use one vm for each instance I assume.

But gns3 slso supports docker instances. If you use a Linux host then you don't need any vm at all. On other systems you need one vm to run docker. The openwrtorg/rootfs image can be used as a router directly, but you may want to use it as a base for your own Dockerfile if you need more packages.

@vgaetera You mean using libvirt to start VMs and then use netem simulate traffic on the virtual interfaces?

@mikma Wow, just imported one docker instance and it directly works! :slight_smile: I want to compile own images with special kernel falgs and so on. That is why I need something I can import myself. But this docker stuff seems awesome!!! :smiley:

Edit: Works means, I was able to start telnet session via gns3... xD

1 Like

@mikma That docker stuff is awesome!!! :smiley: That directly works with latest https://hub.docker.com/r/openwrtorg/rootfs

Offtopic:

Docker containers use the kernel running on the host. It doesn't use a Kernel from OpenWrt.

2 Likes

Even better, than I do not have any issues since my host kernel already ships with the needed modules (I believe). :smiley:

@mikma
Could u describe the limitations of using docker with gns3?
I don't have full control over my network stack, or?

root@d6c348965795:/proc/sys/net/ipv6/conf/all# echo "1" > seg6_enabled 
/bin/ash: can't create seg6_enabled: Read-only file system

If I do the same in GNS3 it works. But I have no ip-full right now installed, to test if it will work.

You should probably use full virtualization, because it's problematic to achieve the proper level of isolation required for testing of kernel specific features with just OS-level virtualization.
Container-based virtualization is not for testing OS, but for deploying/testing applications/software.

1 Like

Containers can be isolated from the docker host with user namespaces. Is that enough? (It's used by default in for example lxd, but not in docker.)

I have now a running virtualbox setup, too.
You can just create a virtuablox x86 system and do this "linked vm".
Further do the settings

  • Start VM in headless mode
  • Allow GNS3 to juse any configured VirtualBox adapter
  • Telnet Console

I have to read more documentation about user namespaces and stuff like this.

Thank you!

There is no way of simulate a wireless link in gns3, or?

what exactly do you need to simulate?

you can do latencies/loss via netem... and there is this - scroll down to add some shaping but with 2.5 stuff like batman... things are difficult... vm pci passthrough... a few cheap devices are alot easier...

2 Likes

I would like to build a wireless network like we have in our Wireless Community (Freifunk Berlin). I want to test new IPv6 features and their impact on our wireless links.

There is also mininet.org, but I think it does not give me a full featured OpenWrt node.

I saw that I can add to a link

  • Frequency Drop Rate
  • Packet Loss Rate
  • Delay/Jitter
  • And BPF Filter

Not sure, if I can maybe measure a link stats and just use them as simulation input for gns3. But I think even other simulation tools have issues with virtual vs real-world deployments.

1 Like

Okay GNS3 is not working? Basic ICMP is working. :wink:
I tried to build an iperf connection and it can't connect.

It works for me anyway. When connecting two openwrt containers via a switch in GNS3 I get 1.15 Gbits/sec. When connecting the wan port on one container to the lan on the other I get 3.18 Gbits/sec. I also tried OpenvSwitch but only got 158 Mbits/sec.

BTW the Cloud device seems very slow, but the NAT device is usable if you need Internet access (package download).

2 Likes

What. :open_mouth: Okay, I will try again!!! :smiley: Maybe I did something wrong. :sweat_smile: