LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-12-2011, 01:23 PM   #1
imoulas
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
IPTABLES port redirecting to SQUID


hello all,

i've got a software that uses a specific tcp port e.g 11111. i want to redirect all the traffic from 11111 to squid port 3128. i'm using the following commands to redirecting:

iptables -t nat -A PREROUTING -p tcp -m tcp -i eth0 --dport 11111 -j DNAT --to 192.168.0.1:3128
iptables -A FORWARD -p tcp -m tcp -i eth0 --dport 11111 -j ACCEPT

my ubuntu server has two interfaces. eth0 is for local network (dhcp assigns ips) and eth1 is for internet. my ubuntu server acts as a gateway and as an authentication server for users.

at squid also i have the following configuration regarding my port:
acl myport port 11111
http_access allow CONNECT myport

my squid installation is not transparent as users need to authenticate in order to access the web.

my application is a windows application and of course is not working.
i examined the packets with wireshark and i noticed that when the program tries to access the internet, squid replies with err_invalid_request (the packet contains that data). the program is trying to send some plain text via port 11111 and as far as i can image, somehow squid declines the data.

i cant get rid off squid as i want to pass the traffic from squid. what is the problem?

any ideas?

Last edited by imoulas; 07-12-2011 at 01:27 PM.
 
Old 07-12-2011, 03:14 PM   #2
subho.d
Member
 
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

Rep: Reputation: 19
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 -d ************ --dport 8888 -j DNAT --to 192.168.0.2:80
/sbin/iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.2 --dport 80 -j ACCEPT
 
  


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 - Redirecting one url to another Squid Server tom@work Linux - Server 0 09-09-2010 04:56 PM
[SOLVED] correct/safe iptables rules for redirecting port 80 to 8080 sundoe Linux - Security 3 07-13-2010 08:00 PM
Can't get squidclamav redirecting with squid 2.6 billymayday Linux - Software 1 11-12-2008 07:08 PM
redirecting a port on the same host with iptables nacio Linux - Networking 4 05-23-2008 01:15 PM
debian iptables squid - redirect port 80 to port 8080 on another machine nickleus Linux - Networking 1 08-17-2006 12:59 AM

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

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