LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-21-2009, 02:35 PM   #1
gariani
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Question Shifting to a site that does not pass by the squid authenticated


Hello everyone.
First of all, I would say that my English is not the best, so excuse anything.

I am facing the following situation:

I'm building a server squid authenticated with a server firewall, the structure would be the INTERNET <---> (eth0) FIREWALL / SQUID Authenticate (eth1 )<---> internal network.

- Eth0 is the card that connects to the modem, but it has static ip (192.168.1.2) and the internet real ip is dynamic.
- Eth1 (192.168.2.0/24) is to provide the internal network ips through DHCP server.

Need, through iptables divert a particular site so that it does not pass by the squid, because it uses port 80 but not for http, and when he passes through the squid, the application site does not work, and also making use of that rule the squid, to direct it, it also does not work.

Searching on the net, I saw that if you use "iptables-t nat-A POSTROUTING-s 192.168.2.0/24-j MASQUERADE", my users will access the site normally, but if I shot the configuration of proxy in the browser, the users can navigate normally, how can I avoid this and release only the specific site I want, where he makes use of ips 200201166200, 200201174207 ...


I'm seeing really crazy over this problem, as I do not have much knowledge of iptables, that makes my situation even more.

If anyone has any ideas, I am grateful.

Att.
 
Old 07-21-2009, 02:46 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by gariani View Post
Hello everyone.
First of all, I would say that my English is not the best, so excuse anything.

I am facing the following situation:

I'm building a server squid authenticated with a server firewall, the structure would be the INTERNET <---> (eth0) FIREWALL / SQUID Authenticate (eth1 )<---> internal network.

- Eth0 is the card that connects to the modem, but it has static ip (192.168.1.2) and the internet real ip is dynamic.
- Eth1 (192.168.2.0/24) is to provide the internal network ips through DHCP server.

Need, through iptables divert a particular site so that it does not pass by the squid, because it uses port 80 but not for http, and when he passes through the squid, the application site does not work, and also making use of that rule the squid, to direct it, it also does not work.

Searching on the net, I saw that if you use "iptables-t nat-A POSTROUTING-s 192.168.2.0/24-j MASQUERADE", my users will access the site normally, but if I shot the configuration of proxy in the browser, the users can navigate normally, how can I avoid this and release only the specific site I want, where he makes use of ips 200201166200, 200201174207 ...


I'm seeing really crazy over this problem, as I do not have much knowledge of iptables, that makes my situation even more.

If anyone has any ideas, I am grateful.

Att.
Welcome to LQ!

You could do something like this:
Code:
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -p TCP -i eth1 -o eth0 -s 192.168.2.0/24 -d 200.201.166.200 --dport 80 -m state --state NEW -j ACCEPT
iptables -A FORWARD -p TCP -i eth1 -o eth0 -s 192.168.2.0/24 -d 200.201.174.207 --dport 80 -m state --state NEW -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
This makes sure packets are only forwarded if the destination IP is one of the two.

Last edited by win32sux; 07-21-2009 at 04:03 PM. Reason: Realized it wasn't transparent mode.
 
  


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
squid ntlm authentication only first logon is authenticated. lievendp Linux - Server 2 05-05-2009 07:50 AM
Wanted: Spam filter to bounce authenticated mail to authenticated address Wassercrats Linux - Software 4 11-08-2007 06:56 PM
how i add user name and pass to enter my site lion_heart_300 Fedora 4 02-11-2007 08:28 PM
How to give an authenticated access to a web site for some IP addresses sharad Linux - Security 5 06-01-2006 07:15 AM
How to give authenticated access to a web site for perticular IP addresses sharad Linux - Networking 1 05-29-2006 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:14 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