LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2006, 09:26 AM   #1
tenzan
Member
 
Registered: May 2005
Posts: 58

Rep: Reputation: 15
Smile about proxy server in LAN with one NIC


Hello!

In office we have firewall/router built in FreeBSD. Currently all lan computers go to internet through this server. People don't use proxy server.
I wonder if it is possible to setup squid server which will be between FreeBSD server and computers in LAN? Of course that squid server will have only one NIC and it will be in the same network as other computers in the LAN. Only squid server will have access to internet through the FreeBSD server and other computers in the LAN won't be able to go to internet through FreeBSD, but only through the squid server. As far as I feel I will need to use iptables (and if possible shorewall) for that...
I'm planning to use for squid server debian or gentoo.

Please, tell me about your thought concerning my idea above.

Thanks in advance,
tenzan
 
Old 12-07-2006, 09:58 AM   #2
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Rep: Reputation: 32
Am assuming you know the idea behind squid as a proxy. If your lan will access the internet thru' the proxy which will in turn access the internet thru' the FreeBSD box then you most definately need two NICs.
Here's how it goes: Connect your proxy to the FreeBSD box through eth0 and give it an address in the same subnet as the FreeBSD box assuming that your FreeBSD box has 172.20.x.x. Then on eth1 connect your proxy to a switch if you like which will then open up connections to your lan. however you need to give your machines on the lan the eth1 address which will has to be on the same subnet as eth1's address eg 192.168.x.x.
Then go to squid and do the necessary.
 
Old 12-07-2006, 11:08 AM   #3
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
@tenzan

This can be done by manipulating the routing table and configuring squid as a transparent proxy.

1. configure the proxy server to use FreeBSD's LAN IP as the default gateway, so that the proxy server has internet access through the FreeBSD box
2. configure the squid to be a transparent proxy
3. all other machines in the LAN have the proxy server's LAN IP as default gateway
4. in the proxy server, create an iptable rule to redirect all incoming traffic on certain ports (i.e. 80) to the port the squid is listening on.

As long as you don't give root permission to the users on your LAN machines, they can not change the routing table. The default gateway configuration can also be done by dhcpd if you have one in your LAN.

You may not need another box for the proxy in this case. You may be able to run squid in the FreeBSD box and configure the firewall rules to redirect incoming traffic on certain ports to squid and drop all other packets you don't want.

Hope it helps.

-n
 
Old 12-07-2006, 10:34 PM   #4
tenzan
Member
 
Registered: May 2005
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks to immortaltechnique and nuxrl.

When we talk about routing table, does this always mean that we deal with two NICs?
I'll share with my results as soon as I done with it.

tenzan
 
Old 12-08-2006, 06:08 AM   #5
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
Quote:
Originally Posted by tenzan
When we talk about routing table, does this always mean that we deal with two NICs?
One NIC only.
 
  


Reply



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
Proxy Server for my LAN Ace2005 Linux - Software 2 06-25-2005 01:43 PM
Dual NIC Proxy Server RedCamel Linux - Networking 3 03-16-2005 05:25 AM
Connect to Internet Thru Proxy server on Work lan bhangie Mandriva 1 04-07-2004 09:14 AM
how to connect to the internet in a win98 lan & wingate 5.0.7 proxy server? GNULINUX_NEWBIE Linux - Newbie 1 01-14-2004 10:37 PM
How can I CONNECT my Lan to Internet through a proxy server Mike1234 Linux - Networking 3 07-17-2003 11:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:16 PM.

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
Open Source Consulting | Domain Registration