Giter VIP home page Giter VIP logo

Comments (14)

chantra avatar chantra commented on June 10, 2024

Hi @JasonLZJ

This is my url.py

I assume you mean urls.py

Is the atc_api module enabled in settings.py? Could you pastebin the whole stacktrace if this still happen so we have more data to troubleshoot. Tks

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra thank you very much.
I have fix it but I have a new problem.
I run atcd in my ubuntu server (sudo acted --atcd-wan eth0 --atcd-lan wlan0)
But I see a warning in my web : ATC is not running
what happened? thx

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

@JasonLZJ
are both atcd and the web server running on the same host?
Can you check that atcd is indeed running?
can you run:

sudo netstat -lpnt | grep atc

and paste the output.

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra
In the same server.

netstat -lpnt | grep act print nothing.
I see atcd listen 9090, so netstat -npl | grep 9090 print
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 4859/python

When I run atcd It shows:

INFO:AtcdVService.AtcdNBServerTask:AtcdNBServerTask Server Started on 127.0.0.1:9090
INFO:AtcdVService.AtcdLinuxShaper:Calling initialize_shaping_system
INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -F FORWARD
INFO:AtcdVService.AtcdLinuxShaper:deleting root QDisc on wlan0
INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on wlan0
INFO:AtcdVService.AtcdLinuxShaper:deleting root QDisc on eth0
INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on eth0
INFO:AtcdVService.AtcdLinuxShaper:Restoring shaped connection from DB
INFO:AtcdVService.AtcdLinuxShaper:Request startShaping TrafficControl(device=TrafficControlledDevice(controllingIP='192.168.1.102', controlledIP='192.168.1.102'), timeout=17633.855776309967, settings=TrafficControlSetting(down=Shaping(loss=Loss(percentage=20.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=10, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)), up=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=10, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0))))
INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 192.168.1.102 on interface eth0
INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth0, classid 1:2,parent 1:0, rate 10kbits
INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth0, parent 1:2, loss 0.0%, delay 0
INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth0, classid 1:2, handle 2, rate: 10kbits
INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -d 192.168.1.102 -i eth0 -j MARK --set-mark 2
INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 192.168.1.102 on interface wlan0
INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID wlan0, classid 1:2,parent 1:0, rate 10kbits
INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID wlan0, parent 1:2, loss 20.0%, delay 0
INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID wlan0, classid 1:2, handle 2, rate: 10kbits
INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -s 192.168.1.102 -i wlan0 -j MARK --set-mark 2
INFO:AtcdVService.AtcdLinuxShaper:Request startShaping TrafficControl(device=TrafficControlledDevice(controllingIP='127.0.0.1', controlledIP='127.0.0.1'), timeout=24050.903750658035, settings=TrafficControlSetting(down=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=100, jitter=0, correlation=0.0), rate=10, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)), up=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=100, jitter=0, correlation=0.0), rate=10, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0))))
INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 127.0.0.1 on interface eth0
INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth0, classid 1:3,parent 1:0, rate 10kbits
INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth0, parent 1:3, loss 0.0%, delay 100000
INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth0, classid 1:3, handle 3, rate: 10kbits
INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -d 127.0.0.1 -i eth0 -j MARK --set-mark 3
INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 127.0.0.1 on interface wlan0
INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID wlan0, classid 1:3,parent 1:0, rate 10kbits
INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID wlan0, parent 1:3, loss 0.0%, delay 100000
INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID wlan0, classid 1:3, handle 3, rate: 10kbits
INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -s 127.0.0.1 -i wlan0 -j MARK --set-mark 3
DEBUG:AtcdVService:All tasks started
DEBUG:AtcdVService:VService Active. Awaiting graceful shutdown.

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

Hi @JasonLZJ

so somehow, you have managed to set some shaping for 127.0.0.1 and 192.168.1.102 .

I am not exactly sure what you mean by you click on "turn on" and get a 404. Does the button stays on "turn on"? Or does it change to "Turn off"?
If you were going to navigate to /api/v1/shape/ do you get a webpage that is similar to the screenshot in http://www.django-rest-framework.org/ ?

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra The button stays on "ATC is not running" When atcd run in my server.

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

@JasonLZJ
what about:

If you were going to navigate to /api/v1/shape/ do you get a webpage that is similar to the screenshot in http://www.django-rest-framework.org/ ?

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

@JasonLZJ
Did you get a chance to load page http://youratcuiserver:atcuiport/api/v1/shape/ ?

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra It is ok, Thank you very much.

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

@JasonLZJ I understand that things are working now, correct?

Could you share what you had to change to get to a working state? This may be useful for others in the future.
Tks

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra yep ...things are working now, correct. thank a lot. lol

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

@JasonLZJ Any chances you share why it was not working originally?

from augmented-traffic-control.

JasonLZJ avatar JasonLZJ commented on June 10, 2024

@chantra
When I navigate to /api/v1/shape/ I find the django-rest-framework app not install. so I install it.

from augmented-traffic-control.

chantra avatar chantra commented on June 10, 2024

Thanks for sharing @JasonLZJ !

from augmented-traffic-control.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.