简体   繁体   English

是否可以在 mikrotik 热点网络下使用 django 获取准确的客户端本地 IP 地址?

[英]is it possible to get exact client local IP address using django under mikrotik hotspot network?

when I connected my server to regular router request.META['REMOTE_ADDR'] works fine.当我将服务器连接到常规路由器request.META['REMOTE_ADDR']工作正常。 it gets the correct IP, but when I setup the connection within mikrotik hotspot it gets the DNS IP which is 10.17.1.1.它获得了正确的 IP,但是当我在 mikrotik 热点中设置连接时,它获得了 DNS IP,即 10.17.1.1。 my settings:我的设置:

-> hotspot address 10.17.1.1/24
-> server address 10.17.1.2
-> server was already added in walled garden and IP Binding to bypass hotspot authentication

I got an access to the server website even not logged in to hotspot but i got the client incorrect ip address which always returned as 10.17.1.1即使没有登录热点,我也可以访问服务器网站,但我得到的客户端 IP 地址不正确,它总是返回 10.17.1.1

please help... any best ideas or solutions will be much appreciated!请帮助...任何最好的想法或解决方案将不胜感激! thanks!谢谢!

I'm not familiar with django, but in oryginal mikrotik Hotspot there are variables which you can use on the hotspot website located in your RouterOS.我不熟悉 django,但在 oryginal mikrotik Hotspot 中有一些变量可以在位于 RouterOS 的热点网站上使用。 And for example例如

$(host-ip) or $(ip) $(host-ip) 或 $(ip)

I guess is what you need.我想这就是你需要的。 more about it you can read here https://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot更多关于它你可以在这里阅读https://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过Python获取我的本地IP地址和网络的子网掩码 - Get my local IP address and subnet mask of the network via Python 如何使用aiohttp获取客户端的IP地址 - How to get the IP address of a client using aiohttp Django:使用信号获取IP地址 - Django: Get IP Address using a signal 是否可以从 HTTP 请求 header 中获取客户的 IP 地址? - Is it possible to get a client's IP address from HTTP request header? 使用 Javascript/REST 获取本地网络访问者 IP - Get local network visitor IP using Javascript/REST 使用python获取Raspberry pi的本地IP地址的位置 - Get the location of the Local IP address of Raspberry pi using python 如何使用python Bottle框架获取客户端IP地址 - How to get client IP address using python bottle framework 使用 Kubernetes Python 客户端获取 Ingress 网关 IP 地址 - Get Ingress gateway IP address using Kubernetes Python client 如何在 Django 中获取本地 ip 而不是公共 ip? - how to get local ip not public ip in django? Amazon Web Services:使用python套接字IP地址设置与本地计算机的服务器-客户端连接 - Amazon web services: server-client connection with local machine using python socket ip address setting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM