root@zhangbin-i7660u:/home/zhangbin# dhcpd enp1s0 -pf /var/run/dhcp-server/dhcpd.pid
Internet Systems Consortium DHCP Server 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcp-server/dhcpd.pid
Wrote 0 leases to leases file.
Listening on LPF/enp1s0/00:e0:7c:68:10:10/192.168.1.0/24
Sending on LPF/enp1s0/00:e0:7c:68:10:10/192.168.1.0/24
Sending on Socket/fallback/fallback-net
root@zhangbin-i7660u:/home/zhangbin#
zhangbin@zhangbin-i7660u:~/Downloads/augmented-traffic-control/atcui/atcui$ sudo atcd --atcd-wan enp3s0 --atcd-lan enp1s0 --atcd-dont-drop-packets
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 enp1s0
INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on enp1s0
INFO:AtcdVService.AtcdLinuxShaper:deleting root QDisc on enp3s0
INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on enp3s0
INFO:AtcdVService.AtcdLinuxShaper:Restoring shaped connection from DB
DEBUG:AtcdVService:All tasks started
DEBUG:AtcdVService:VService Active. Awaiting graceful shutdown.
^CINFO:AtcdVService:signal -2 received
INFO:AtcdVService:Received graceful shutdown request
INFO:AtcdVService:Waiting for tasks to shutdown gracefully...
DEBUG:AtcdVService:Waiting for <atcd.AtcdDeviceTimeoutTask.AtcdDeviceTimeoutTask object at 0x7f6d581b4c90> to stop...
DEBUG:AtcdVService.AtcdDeviceTimeoutTask:Thread AtcdDeviceTimeoutTask exited
DEBUG:AtcdVService:Waiting for <atcd.backends.linux.AtcdLinuxShaper object at 0x7f6d581b4a50> to stop...
DEBUG:AtcdVService:Waiting for <atcd.AtcdDBQueueTask.AtcdDBQueueTask object at 0x7f6d581b4a10> to stop...
DEBUG:AtcdVService.AtcdDBQueueTask:Thread AtcdDBQueueTask exited
DEBUG:AtcdVService:Waiting for <atcd.AtcdThriftHandlerTask.AtcdNBServerTask object at 0x7f6d581b4750> to stop...
DEBUG:AtcdVService.AtcdNBServerTask:Thread AtcdNBServerTask exited
INFO:AtcdVService:Instance shut down gracefully
zhangbin@zhangbin-i7660u:~/Downloads/augmented-traffic-control/atcui/atcui$ ls
__init__.py settings.py urls.py wsgi.py
__init__.pyc settings.pyc urls.pyc wsgi.pyc
The error log is straightforward. As it suggested,You need to add 198.211.99.20 to your ALLOWED_HOSTS setting.
In your project settings.py file,set ALLOWED_HOSTS like this :
ALLOWED_HOSTS = ['198.211.99.20', 'localhost', '127.0.0.1']
手机访问
连接到无限路由
无线网络的192.168.1.1:8000
root@zhangbin-i7660u:/home/zhangbin/Downloads/augmented-traffic-control/atcui# python manage.py runserver 0.0.0.0:8000
Performing system checks...
System check identified no issues (0 silenced).
February 14, 2020 - 15:12:20
Django version 1.11.28, using settings 'atcui.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '192.168.1.1:8000'. You may need to add u'192.168.1.1' to ALLOWED_HOSTS.
[14/Feb/2020 15:15:22] "GET / HTTP/1.1" 400 63593
Invalid HTTP_HOST header: '192.168.1.1:8000'. You may need to add u'192.168.1.1' to ALLOWED_HOSTS.
[14/Feb/2020 15:15:22] "GET /favicon.ico HTTP/1.1" 400 63634
Performing system checks...
System check identified no issues (0 silenced).
February 14, 2020 - 15:18:12
Django version 1.11.28, using settings 'atcui.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '192.168.1.1:8000'. You may need to add u'192.168.1.1' to ALLOWED_HOSTS.
[14/Feb/2020 15:20:48] "GET / HTTP/1.1" 400 63748
Invalid HTTP_HOST header: '192.168.1.1:8000'. You may need to add u'192.168.1.1' to ALLOWED_HOSTS.
[14/Feb/2020 15:20:48] "GET /favicon.ico HTTP/1.1" 400 63654
Performing system checks...
System check identified no issues (0 silenced).
February 14, 2020 - 15:21:48
Django version 1.11.28, using settings 'atcui.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[14/Feb/2020 15:23:23] "GET / HTTP/1.1" 302 0
[14/Feb/2020 15:23:23] "GET /atc_demo_ui/ HTTP/1.1" 200 2332
[14/Feb/2020 15:23:23] "GET /static/css/atc.css HTTP/1.1" 200 538
[14/Feb/2020 15:23:23] "GET /static/static_jquery/js/jquery.min.js HTTP/1.1" 200 95786
[14/Feb/2020 15:23:23] "GET /static/bootstrap/js/bootstrap.min.js HTTP/1.1" 200 36966
[14/Feb/2020 15:23:23] "GET /static/vendor/react/react-0.13.3.js HTTP/1.1" 200 600572
[14/Feb/2020 15:23:23] "GET /static/bootstrap/themes/default/css/bootstrap.min.css HTTP/1.1" 200 121710
[14/Feb/2020 15:23:23] "GET /static/vendor/react/JSXTransformer-0.13.3.js HTTP/1.1" 200 493024
[14/Feb/2020 15:23:23] "GET /static/js/atc-api.js HTTP/1.1" 200 4056
[14/Feb/2020 15:23:23] "GET /static/js/atc-profile-storage.js HTTP/1.1" 200 827
[14/Feb/2020 15:23:23] "GET /static/js/atc-auth.js HTTP/1.1" 200 5689
[14/Feb/2020 15:23:23] "GET /static/js/atc-utils.js HTTP/1.1" 200 2793
[14/Feb/2020 15:23:23] "GET /static/js/atc-shaping.js HTTP/1.1" 200 7003
[14/Feb/2020 15:23:23] "GET /static/js/atc-profiles.js HTTP/1.1" 200 5038
[14/Feb/2020 15:23:23] "GET /static/js/atc.js HTTP/1.1" 200 8356
[14/Feb/2020 15:23:24] "GET /api/v1/auth/ HTTP/1.1" 200 45
[14/Feb/2020 15:23:24] "GET /api/v1/token/ HTTP/1.1" 200 79
Not Found: /favicon.ico
[14/Feb/2020 15:23:24] "GET /api/v1/profiles/ HTTP/1.1" 200 2
Not Found: /api/v1/shape/
[14/Feb/2020 15:23:24] "GET /favicon.ico HTTP/1.1" 404 2403
[14/Feb/2020 15:23:24] "GET /api/v1/shape/ HTTP/1.1" 404 54
Not Found: /api/v1/shape/
[14/Feb/2020 15:23:24] "GET /api/v1/shape/ HTTP/1.1" 404 54
[14/Feb/2020 15:23:27] "GET /api/v1/token/ HTTP/1.1" 200 79