How to install and setup OpenWrt on gns3 topology

Hello there edward here i am kind a new in openwrt router but i have taken a college project
where i have to run openwrt in gns3 and from gns3 i have to take openwrt web interface viva a different vm all to gather
thing i am done with is i have install openwrt on my gns3 and with the guest system as well
the issue i am have is that openwrt is not getting a internet connect when if i am providing it through gns3 could someone help me out here.

Which architecture are you expecting to emulate and how (especially if you're going to emulate wireless)?

If you don't need wireless, the x86_64 images run on typical VMs, for example https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm

jeff thank you for replying it a docker in gns3 and it version is chaos calmer 15.05.01 and it a qemu system -x86_64 bit

I had some good success with QEMU armvirt... bridged out via tap/tun interface.... Been a while since i've used gns but i'm assuming it now has some sort of bridging abilities so assuming they are robust should be fairly straight forward..... once your up to speed / confident configuring / debugging that end of the setup.

Divide and conquer!

wulfy23 thank for the relpy but could you tell me how to assign a ip address to a vm which is connected to the openwrt router, and i basically want the gui webpage of the router throught the vm which is connect to?

Well, without knowing the totality of your setup... it's difficult.

You have to break down each component to it's bare essentials and troubleshoot from there.

From the QEMU->Physical bridging.... It was necissary for me to shift my Debian interface into a bridge.... Manually add the tap / tun interface to which the QEMU guest would bind to.....

Here is the wrapper script I used to power on the vm...

#!/bin/bash
../_scripts/qemu-ifup tap0

#-append "initrd=/bin/sh init=/bin/sh addtty" \
#-append "root=/dev/vda1 debug=4 console=tty0 addtty" \

qemu-system-arm -nographic \
	-M virt -m 512 \
	-kernel ramfs \
	-append "debug=4 addtty" \
#	-hda sq.qcow2
	-net nic -net tap,ifname=tap0,script=no,downscript=no


../_scripts/qemu-ifdown tap0

The ifup / down scripts just make sure the underlying tap0 and br0 etc exist and are up... as described... here...... https://blog.elastocloud.org/2015/07/qemukvm-bridged-network-with-tap.html

I will need to poke around my filesystem to find a working one if you need it..... but the main issue I had was getting the qemu command, not the tap0.....

If the machine fires up and you have no connectivity.... chances are it's just a matter of breaking the components down and testing each aspect......

Can you get another vm to work?
Can two vm/s contact each other...?
Is your arp table populated?
Are you having firewall issues?

Be more specific about what is not working and dont use the word vm.... it;s confusing.... say "QEMU guest" or "VIRTUALBOX guest interface" or "Host Interface" etc. etc.

At the end of the day... I reckon try it with something you find more comfortable...... substitute aspects of the topology and see if it works...... 90% of solving a problem is defining it correctly.....

Good luck!

wulfy thank you every for the insight to my problem i will look into it asap and let you know how it when down anything else i should know before hand

no worries... well, i just had a poke around and it seems like running in virtualbox might be a better ( easier ) choice here......

took a few secs and I had the virtual owrt bridged no probs.... but my first hurried attempt to get gns3 talking to virtualbox was not as simple as it is supposed to be.....

if you have virtualbox "linking" with gns ( gns gui picks up your vm's - aka vbox guests ) ..... then you'd be pretty close to a working setup.....

report back in a day or whatever and i might be able to dig a little further and help ya.....

anyone else if you know some tricks that need to be done with the "vboxwrapper.py" part of gns3 that hooks into virtualbox ( it's trying some 127.0.0.1-11525 socket which is failing..... i'm guessing userlevel privileges cannot create that socket or similar...... couldn't find any references to it in the virtualbox u.i. ???

by all means chime in with the tips :wink:

thank you again and sorry for the late reply i will try it out asap the college start from 28th Dec and i have already link my guest pc which again in virtual box (and imported it in gns3) and owrt docker container which is in gns3 itself and let you know when i ready out y'all method.

Happy Christmas and thank you for helping a noob out :yum:

well ... i spent a tiny bit of time on this.... and... i haven't really helped you much.... as i mentioned it had been years since i'd used gns so it was kinda cool firing it up and seeing just how far it's come!

i don't use docker... ( yet ).... so it might be something i have to delve into soon.

i spend an hour or few banging my head against the wall trying to get gns to play nice with virtualbox ( vboxwrapper.py ) but it wouldn't play ball on my system. ( debian )

if you have gns "talking" with virtualbox ( are you running on win? ) then that is really the hardest part of the process.

i suspect any other issue will lie in the network / vnet soup that sits between whats physical and what the GUESTOS touches.....

like i said... switching up your perspective is the best angle of attack with that kind of issue.

things like;

-another virtual host / guest / container next door - can they talk?

not coming from a physical networking background trips alot of students up in the virtual world. and vice versa i suppose...

another big issue that has tripped me up many times is the ARP process.... or layer 2.

when you clone, when you switch network ( physical or virtual ).... many times i've seen issues with ARP population.

So when/if your ping fails make sure your running "arp -a/arp -d" etc etc...... and that you see proper unique macs there or not there.....

:slight_smile:

Srry for the late reply holiday season and happy new year to all of you i will let you know when i try it out in my college but my gns talk to virtualbox normal it should, i guess i was luck
but i let you know how it pans out
Again happy new year

hi there wulfy my openwrt and the vm that is acting as client are now communicating and i can access my openwrt vm thought it and installed the required packages on it nw just wanted to ask this

  1. How do i give wan interface a static ip on a real hardware
    ( I am asking this becouz my mentor in the college has asked me to replicates this thing on a real router aside vm now two thing i have a router which is nt in use. But i have a router which is connected to active link from which internet is accessable but i don't want to flash this one because my isp has done ip/mac binding so it long proccess

So what was i thing is i will flash the router which is not in use and change the wan interface connecting setting thought shell script and give it a ip which is provide by the (router which is providing the internet access) and then download the necessary packeage.

are there any other file that i have to change to get the state process
the file i am thing is to change is in /etc/config/network please let me know

Great to hear that is working!

What model is the spare router you have?
What medium / provider is your internet?
Do you have access to the current/ISP router? ( does it have a DMZ or port range forward feature? )
How critical is uptime for you? Do many people use and rely on your internet connection?
Is doing this mandatory for your marks/grades etc?

What package do you mean? Are you talking about the process of flashing it with OPENWRT?

WANMAC is generally quite simple to do.... some providers also require special link layer "ID's" such as setting a VLAN for the WAN port pvc etc. So we find that out.... and then the model.

Seriously tho' - putting your "test" router BEHIND your edge router and imagining that your LAN is now the WAN for your test setup.... Openwrt or not...... is pretty much the nuts and bolts of doing it physically...... ( except the protocol depandant things I discussed above ).... and setting the DMZ or port forwarding on the ISP router to the "test" router's "WAN" ( well the ip it gets on your regular LAN ) gets you access from outside..... ( you can web search for DOUBLE NAT ) and hopefully find a picture to make more sense......

I hope some of that made sense....... Just let us know the model and there is nothing stopping you from trying like i said with its current software "behind" your existing router......

at the moment i don't the model name or it resource that it has my college has not yet started it
but i will let you kown the spec i going to install in my vm of openwrt.

just one thing how the hell do i config a multiple wan link
i am using mwan3 for load balancing
trying here to achieve redundant link so that if one fails there is a backup link up and ready for action and it a pppoe connection in my lab( you had asked what kind of connection we have in my environment or college lab as i know :slight_smile: )

Well somethings to consider;

-MEDIA / CONNECTION TYPE ( of the multiple links )
What speeds / amounts of data / latency / outgoing or incoming too / price

-DESIRED FUNCTIONALITY
i.e.
*load balance ( simultaneous bandwidth sharing )
*redundancy ( cold standby / fallover... hot standby etc. )
*cost / path efficiency

DUAL WAN is tough when you don't look at the whole picture and factor in your needs vs technical constraints.

Implementation wise..... it's good to take a broad look at what needs to happen to ensure that the above outcomes and constraints are addressed.

-Link ( wan ) Establishment / Reliability / Strengths / Weaknesses / Availability

It's all too common to find that you physically either cannot get many WAN link types.... or that they are simply not capable of delivering the required performance.

-Link Monitoring ( support is a factor here )

What needs to happen, how will you ( or the router ) know, is it reliable...... Is it needed?

-Hysteresis / Complexity

Speed of actions, how that interrelates to the rest of the system, what is impacted and when..... Is a simpler option less ideal to one need, but in a broad sense more robust.

So think about those things and come up with a scenario.... or set of needs.... and then you can sit down and map out the best technology to fit them :slight_smile:

we do have the list of package that need to be installed in firmware.
but i messing around with the os and tried to create my on "wan" link i don't know the what file is need to change along with network file all and all the it great firmware i

Meh, just make one link at a time :slight_smile: Ping.... Keep you testing isolated.... one host from one interface..... build..... test...... draw...... keep very simple.....

I can see how what i wrote above might be confusing....

tommorrow i'll draw something up.... to apologise :wink: