LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-13-2013, 11:45 PM   #1
neopandid
Member
 
Registered: Aug 2011
Location: Russia
Distribution: Debian
Posts: 32

Rep: Reputation: Disabled
Is it possible to use squid in same ip subnet with WAN IP? Iptables Squid port problem.


I have squid machines they all have 2 nics and
Modem --> eth0(192.168.1.0/24) Squid eth1(192.168.2.0/24) --> LocalSwitch

But recently, Programmers requested from me that I have to use the same ip subnet for two nics.
Ex:
Modem(192.168.1.2)------->eth0(192.168.1.3)Squid eth1(192.168.1.20)------->LocalSwitch

Before this request my iptables rules:
#!/bin/bash
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.10:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-port 3128

But this is not working anymore and
I have trouble writing new iptables script.
How can I do that?
Can you help me on this?
Thanks in advance.

Last edited by neopandid; 03-14-2013 at 03:44 AM.
 
Old 03-15-2013, 08:49 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's not possible, as your squid box would no longer be being used as the route between the client and the internet. As you've got (HORRIBLE) transparent proxying, you have to contrive a routing layout so that you see that traffic and intercept it. You'd have to do some weird stuff to make the clients route to your machine and then back out again the same interface to the net.

This is all horrible. Best advice is to rip out the transparent rules and just tell them to hit the proxy directly.
 
1 members found this post helpful.
Old 03-18-2013, 02:14 AM   #3
neopandid
Member
 
Registered: Aug 2011
Location: Russia
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: Disabled
I thought so, too.
Thanks a lot.
I will explain this to my manager.

Last edited by neopandid; 03-18-2013 at 03:09 AM. Reason: typo
 
  


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
Redirecting trasparent squid traffic to squid by using iptables imran76 Linux - Security 1 03-13-2012 07:49 AM
squid port 8080, iptables? qwertyjjj Linux - Newbie 11 10-06-2011 10:58 AM
IPTABLES port redirecting to SQUID imoulas Linux - Server 1 07-12-2011 03:14 PM
debian iptables squid - redirect port 80 to port 8080 on another machine nickleus Linux - Networking 1 08-17-2006 12:59 AM
problem with squid and iptables myheart Linux - Networking 2 01-13-2005 07:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:47 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
Open Source Consulting | Domain Registration