Hello. I hope someone will be able to help me. I need to use torch to get client src ip address connecting to the webserver (behind NAT). So far i used simple ssh2_exec to get all stuff that I needed. Unfortunately with torch i get no output. I thought if I use some API Ill get what I need... But now Im stuck. Im not familiar with any kind of API, ive tried to use write(‘tool/torch’,‘=interface=ether2’) with no luck - I mean - api is reading the output no end. How to stop command exec for example after 2 seconds? Is it possible? I`ve tried write(‘/cancel’) - no luck… Is it even possible to get any output by this command? Tested on MT 3.17. Thanks in advance 4 all replies.
Unfortunately, /torch is still not working via API =(
We’re waiting and waiting…
Holy shit, thanks for reply. At least I know its impossible… Hmm maybe someone knows how to make it… I have a router under control MT 3.17. Network is routed - static routing (different subnet for main routers and different subnet in each ap for clients) Now each client see only gateway, that of course knows all routes to subnets. On router works NAT.. Now I have a standalone webserver in my network). Id like redirect specific clients (those not paying) to the serwer where they could see notice... The problem is, that if they connect with the webserver, script that works on it, responsible for displaying the message doesnt know, whos acctually looking the page, because client address is NATed on router... First I thought - when client connect to the webserver -script will connect to the router and will check using command /ip firewall connection whos connected to the server.. Unfortunately it didnt work (dont know why) because those connections isnt shown in ip firewall... at least not on the router. When Ill check on MT 2.9.51 (some ap between router and the webserver) I see all those connections - of course as src-adddress I see router address. Maybe someone knows a workaround.
it’s toooooooo complicated… =)
why do you need to use src-NAT? you need onlu dst-NAT to redirect users’ requests to your webserver
Yeah, youre right... Ill give an example - client 192.168.1.20–(AP) 192.168.252.20----192.168.252.1(ether-lan)-ROUTER–88.xx.(ether WAN)—Webserver (88.xxx)
So… NAT complicates everything. Id like to know (true) client IP connected to the webserver - in that case it would be 192.168.1.20. Because of NAT Ill get 88.xx,xx,… I hope all is clear now
Thats why Ive tried to use torch or connection tracking… With no luck so far ![]()
well, maybe you may use WebProxy, and on your website, read ‘X-Forwarded-For’ header entry
Any update? I’m looking for API sample code that torches, any language will do.