LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2005, 01:41 AM   #1
jcbeckettnz
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Setting up an internet gateway with web usage logging


Hello,

I would like to setup a Linux server that simply sits between my firewall/router & the rest of the network.

I do not wish it to cache. It simply needs to provide NAT so the network can browse the internet.

However, I would like to able to log all of the intrernet traffic. I need to know what websites paticular users are accessing & whether they are using MSN Messenger, ICQ etc etc.

I am sure this is possible, but being new to Linux I don't know what software will provide the above our how to go about setting it up.

Can anyone who could provide a step in the right direction?

Thanks
 
Old 04-27-2005, 01:53 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
you can do this by using squid in transparent proxy mode...

http://www.squid-cache.org/

just my two cents...


PS: yes, squid can be configured to NOT cache...

PS2: the NAT would be done by your current firewall/router, not by squid... if you want the squid box to do NAT also, then you could do that with iptables...


Last edited by win32sux; 04-27-2005 at 02:58 AM.
 
Old 04-27-2005, 02:02 AM   #3
jcbeckettnz
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
I have come across Squid through my search of the web.

Is it easy to log web usage through Squid?
 
Old 04-27-2005, 02:55 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
yes, it's easy... and there's a ton of tools to help you analyze the logs... for example:

http://www.squid-cache.org/Scripts/
 
Old 04-27-2005, 07:57 PM   #5
jcbeckettnz
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
thanks heaps.

I will build a linux box this weekend, install Squid and see what happens.
 
Old 04-28-2005, 06:05 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
cool... let me know how it goes... and if you have any further questions don't be shy... i can share a known-good squid.conf with you if you want... i can also show you which iptables rules you'll need for the transparency... good luck... have fun...
 
Old 05-03-2005, 12:17 AM   #7
jcbeckettnz
LQ Newbie
 
Registered: Apr 2005
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Didn't get time over the weekend to build a Linux box. But am in the middle of building a FC3 box right now.

If you are keen to share the iptables commands for transparency that would be cool.

Thanks.
 
Old 05-03-2005, 09:20 AM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
basically they look like this (if eth1 was your LAN interface):
Code:
iptables -t nat -A PREROUTING -p TCP -i eth1 --dport 80 \
-j REDIRECT --to-ports 3128
iptables -A INPUT -p TCP -i eth1 --dport 3128 -j ACCEPT
also, remember that you'll need to compile squid with support for this by adding this option to your ./configure before your make:
Code:
--enable-linux-netfilter

Last edited by win32sux; 05-03-2005 at 09:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tools for Logging Network Usage Statistics sadscientist Linux - Networking 1 11-26-2005 04:28 PM
Setting up gateway to share internet for private LAN muru Linux - Networking 6 09-17-2005 09:08 PM
Logging CPU / Memory Usage bastien Fedora 1 05-07-2005 10:16 PM
internet gateway: how to log usage? reetep Debian 3 04-17-2004 02:03 PM
Logging data usage Jazza005 Linux - Networking 7 03-17-2003 02:17 AM


All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration