Hi I have setup the OpenWrt (Chaos Calmer) in my router, now I want to log the ipaddress, mac address, requested site url and port using a proxy.

Which proxy server is best to achieve the above problem. And how can I achieve this.

So to put it precisely, user is connect to my wifi router. When he browses anything in his mobile or desktop, the request first comes to router. In my router I need to log the above mentioned details in one text file and we need to store it for a month as per my company policies.

I have setup a CRON job to export the log data from router to my unix server, so that the router wont get crashed because of the logs.

Any help really appreciated.

  • 1
    An openwrt box with limited resources is not the best place to do this kind of logging. – Rui F Ribeiro Sep 6 '17 at 18:02
  • You should not use the openwrt box neither for a proxy, nor for logging purposes. It is too limited. Setup the proxy/logging in a Linux server outside the openwrt traffic, and divert the HTTP traffic there with iptables rules. – Rui F Ribeiro Sep 6 '17 at 18:15
  • @RuiFRibeiro the plan was to install proxy in router and store in the local router so that every 15minutes the logged data will be pushed to the linux server. – Channaveer Hakari Sep 7 '17 at 6:06
  • @RuiFRibeiro I am really new to this type of work. Can you please explain me more of redirecting to proxy/logging in a linux server via iptables. How do I redirect the calls back to router from linux server – Channaveer Hakari Sep 7 '17 at 6:08

You can use squid in transparent proxy mode for logging. You will have to write ACLs for logging the above mentioned information. Squid is a very powerful proxy for applying access control policies, if you require. You can also log HTTPs traffic using squid.

You can use access_log directive of it and there is also an option to integrate it with syslog daemon. Check out Squid Page.

  • 1
    Hey the Squid is bit heavy. How about Privoxy. Does it sound promising to do the request stuff. wiki.openwrt.org/doc/howto/proxy.privoxy . How about TinyProxy wiki.openwrt.org/doc/howto/proxy.tinyproxy – Channaveer Hakari Sep 6 '17 at 9:39
  • 1
    Privoxy is looking tailored-made for embedded systems. You can use it for sure. Squid is heavy when you want to use its full potential but since you just need logging, you can disable its caching and other configurations. – enZyme Sep 6 '17 at 10:15
  • Why the Squid package is not listing. I used opkg list squid*, opkg list squid but any of those didnt work. Any other alternative way to install those – Channaveer Hakari Sep 6 '17 at 10:33
  • link Other package info is given here. If that too doesn't work, use its rpm to install. – enZyme Sep 6 '17 at 10:44
  • Hi I am not getting how to use rpm to install openwrt. Can you please guide me how to use rpm. – Channaveer Hakari Sep 6 '17 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.