How to use the topology API and setup router as Dumb AP (802.11s but with LAN)

94 views
Skip to first unread message

Mirza Arnaut

unread,
Aug 9, 2020, 3:31:00 PM8/9/20
to OpenWISP
Hello,

For the first question: I wanted to display my test network using the topography but I am unable to use it with the url of the container (eg. "topology.wisp.example.org").
Is there a tutorial on how to setup it up and debug stuff (endpoints for testing maybe?) so I can debug it myself.

As for my second question: I currently want to expand the WiFi range of my Redmi AC2100 using a Xiaomi Mi WiFi R3 over LAN.
I am thinking of something like described in this OpenWRT post. It is easy until I would have to type something in the console.
I just want to know, if I would need to do this always over SSH or is it possible to realize this over some templates?
If not, I would probably resort to using 802.11s, which will give me some performance penalty, but it should be much easier to setup everything up on a fresh install!

Best regards
Mirza

Federico Capoano

unread,
Aug 10, 2020, 9:00:24 PM8/10/20
to OpenWISP
On Sun, Aug 9, 2020 at 2:31 PM Mirza Arnaut <mirza.a...@gmail.com> wrote:
Hello,

For the first question: I wanted to display my test network using the topography but I am unable to use it with the url of the container (eg. "topology.wisp.example.org").
Is there a tutorial on how to setup it up and debug stuff (endpoints for testing maybe?) so I can debug it myself.
 
I'm not quite sure of this, maybe Ajay knows more.

As for my second question: I currently want to expand the WiFi range of my Redmi AC2100 using a Xiaomi Mi WiFi R3 over LAN.
I am thinking of something like described in this OpenWRT post. It is easy until I would have to type something in the console.
I just want to know, if I would need to do this always over SSH or is it possible to realize this over some templates?
If not, I would probably resort to using 802.11s, which will give me some performance penalty, but it should be much easier to setup everything up on a fresh install!

Looks like a series of openwrt configs, I do this all the time with templates, more complex setups are possible as well.

Ajay Tripathi

unread,
Aug 11, 2020, 5:50:24 AM8/11/20
to OpenWISP
Hi,
 
Is there a tutorial on how to setup it up and debug stuff (endpoints for testing maybe?) so I can debug it myself.

You can set the `DEBUG_MODE` variable in `.env` file to `True`, then go to the `http://topology.wisp.example.org/api/v1/` URL on your browser.
That should help you debug if there is an error in the API.

However, I think that you''ve made changes to the network, so it's possible that controller is not able to access network-topology container.

In that case, you'll have to:

1. docker exec -it docker-openwisp_controller_1 bash
2. apt update & apt install curl
3. curl topology.internal/api/v1/

You should see the django error page ending with "You're seeing this error because you have <code>DEBUG = True</code>". Which means, the containers are able to communicate.

Lastly, docker-compose logs:

1. docker-compose logs topology
2. docker-compose logs controller should help to spot any errors once `DEBUG_MODE=True` is enabled.

This information should help you get started with debugging, let me know if there anything else I should mention.


Best,
Ajay Tripathi

Mirza Arnaut

unread,
Aug 11, 2020, 7:42:31 AM8/11/20
to OpenWISP
Hi,

I did change my network and fixed some things and I am now able to reach the topology container via nginx an the internal url.
I also get the mentioned message response back with the curl command, but when I try to access the url via Chrome, it says the endpoint does not exist.
The only output produced in the topology logs are that the endpoints are not found.
Maybe my traefik specific configuration is making some problems here?

Best regards,
Mirza

Mirza Arnaut

unread,
Aug 11, 2020, 7:44:58 AM8/11/20
to OpenWISP
How would I go about disabling the firewall and dhcp(v6)?
Until then it is quite straight forward, since I know how to control it via templates.

Ajay Tripathi

unread,
Aug 11, 2020, 8:20:17 AM8/11/20
to OpenWISP
Hi,

On Tuesday, August 11, 2020 at 5:12:31 PM UTC+5:30 Mirza Arnaut wrote:
The only output produced in the topology logs are that the endpoints are not found.

I see. I think in that case it should be working, can you please:
1. Go to https://dashboard.example.com/admin/topology/topology/add/
2. Create a fetch topology (You may use https://pastebin.com/raw/EnRBaxYR for testing)
4. Now, open the newly created topology and click "View topology graph"

If you see the nodes, we can confirm it's working. Otherwise, please share any errors in console or the response of the request made when you click "View topology graph".


Ajay
 

Mirza Arnaut

unread,
Aug 11, 2020, 7:11:25 PM8/11/20
to OpenWISP
I found out where the problem ist.
Since I have the openwisp nginx begind a different proxy, it handles all SSL certificates.
But when I then open the dashboard and try to load the topology of the sample you gave me, it says in the console it cannot make an http request coming from an https site.
I suppose SSL_CERT_MODE=Yes enables https for the nginx, but it also tries to do the http-01 challange, which obviously fails here since all http traffic is redirected!
Is there a way to manually change the requests from http to https without using the mentioned flag?

Mirza

Ajay Tripathi

unread,
Aug 12, 2020, 7:27:53 AM8/12/20
to OpenWISP
Hi,

On Wednesday, August 12, 2020 at 4:41:25 AM UTC+5:30 Mirza Arnaut wrote:
Is there a way to manually change the requests from http to https without using the mentioned flag?

Setting it to `No` / `External` according to your case should solve the problem.


Ajay

Mirza Arnaut

unread,
Aug 12, 2020, 8:36:05 AM8/12/20
to OpenWISP
Sorry, should have red the documentation more thoroughly ..
I got it working with the provided pastebin link and I can see the topology of the network.
So far so good.
Now I am not quite certain how to display my own network topology here.
And sorry for bothering you so much!

Ajay Tripathi

unread,
Aug 12, 2020, 10:50:00 AM8/12/20
to OpenWISP
On Wednesday, August 12, 2020 at 6:06:05 PM UTC+5:30 Mirza Arnaut wrote:
Sorry, should have red the documentation more thoroughly ..

No problem, multiple people have missed the env documentation, I think the docs need to be improved
to get user attention to it. I'll look into it when possible.
 
Now I am not quite certain how to display my own network topology here.

Can you please ask a more specific question, what is the problem you are facing to display your topology?
 

Ajay

Mirza Arnaut

unread,
Aug 12, 2020, 11:35:50 AM8/12/20
to OpenWISP
Basically I want to know from where can I fetch my current toplogy?
Is it possible or do I have to generate that somehow else?
I thought that this would be done by the topology container. Or am I missing some adequate endpoint for this?

Mirza

Federico Capoano

unread,
Aug 13, 2020, 10:41:30 AM8/13/20
to OpenWISP
Hey Mirza, I'm not sure I understood your question very well.

To fetch the topology, you must have a source of data which knows the topology, eg: openvpn, OLSRd or another networking software who knows it.
You can either fetch it or have a script send it in POST.

I hope this helps, if you have further questions, please be more specific.

Best regards
Federico Capoano


Mirza Arnaut

unread,
Aug 13, 2020, 6:21:40 PM8/13/20
to OpenWISP
Hello Frederico,
Sorry for my unclear question.
I just wanted to know how to get the topology data or better said how to generate them for my current network (since I thought that the topology component would do that for me).
I will try to read up on how to generate it with openvpn, but I would really grateful if you have a tutorial to recommend for beginners.

Mirza

Federico Capoano

unread,
Aug 23, 2020, 5:57:07 PM8/23/20
to OpenWISP
For OpenVPN, you need to enable the status file, look for --status in this document: https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/

Create a topology using the receive strategy, copy the suggested POST URL. 

Then create a script that gets the status file and sends it in post to the POST URL you copied before.

The script looks like this:

#!/bin/sh
COLLECTOR_URL
="{{ openwisp2_management_topology_url }}"
DATA
=$(cat "{{ openwisp2_management_openvpn_status_log }}")
curl
-s -X POST -d "$DATA" --header "Content-Type: text/plain" $COLLECTOR_URL
_ret
=$?
echo
''
exit $_ret

Federico
Reply all
Reply to author
Forward
0 new messages