LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 07-15-2006, 10:31 PM   #1
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Rep: Reputation: 2
Unhappy IP tables, im stuck


this is the my iptables script for squid transparent proxying

----------------------------------------------------------------------------
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
----------------------------------------------------------------------------
but this is the result of the script..

----------------------------------------------------------------------------
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 redir ports 3128

----------------------------------------------------------------------------

my problem is the "source" and "destination" tables.. the values for this should be "anywhere" right?.. not 0.0.0.0/0.. any help guys.. thanks
 
Old 07-15-2006, 10:57 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Hi,

0.0.0.0/0 is "anywhere."

The slash zero on the end means "match the first zero bits." In otherwords, everything matches.
 
Old 07-15-2006, 11:05 PM   #3
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
im confused.. because i have a friend who has configured squid.. and when he showed mo his iptables, the source and destination is "anywhere"

im configuring transprent proxying.. but my linux box is behind a router.. so he said that i should make my linux box as gateway to enable transparent proxying.. but i only have one ethernet card..
but he said that it is still possible using iptables..

i also configure the iptables script for that but the result is 0.0.0.0/0..
 
Old 07-15-2006, 11:41 PM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by bluekill14
im confused.. because i have a friend who has configured squid.. and when he showed mo his iptables, the source and destination is "anywhere"
My experience is that when "-n" is specified with "-L," iptables will list "match anything" as "0.0.0.0/0." If "-n" is not specified it will say "anywhere."
 
Old 07-15-2006, 11:51 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
To perform transparent proxying, the computer in question MUST be in the routing chain between the source and the destination.

And yes, 0.0.0.0/0 is "anywhere." As a sample rule, on my box, iptables -L reveals:
Code:
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
while iptables -L -n shows:
Code:
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22
Both cases are the same rule, just one is shown "numerically" while the other has common names substituted. iptables-save, for example, will ALWAYS use the numeric form.
 
Old 07-16-2006, 09:19 PM   #6
bluekill14
LQ Newbie
 
Registered: Jul 2006
Posts: 20

Original Poster
Rep: Reputation: 2
thanks for all the help!.. i have already configured transparent proxying.. lets all study linux!!!
 
  


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
IP Tables gjagadish Linux - Networking 1 02-10-2006 05:33 PM
IP Tables gjagadish Linux - Security 1 02-10-2006 11:49 AM
IP Tables help muru Linux - Security 3 09-27-2005 11:39 PM
what are ip tables? master Linux - Security 4 01-24-2005 07:59 PM
Ip Tables Mag|c Linux - Security 3 06-26-2003 10:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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