LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   IP tables, im stuck (https://www.linuxquestions.org/questions/fedora-35/ip-tables-im-stuck-464448/)

bluekill14 07-15-2006 10:31 PM

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

blackhole54 07-15-2006 10:57 PM

Hi,

0.0.0.0/0 is "anywhere."

The slash zero on the end means "match the first zero bits." In otherwords, everything matches.

bluekill14 07-15-2006 11:05 PM

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..

blackhole54 07-15-2006 11:41 PM

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."

Matir 07-15-2006 11:51 PM

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.

bluekill14 07-16-2006 09:19 PM

thanks for all the help!.. i have already configured transparent proxying..;) :) lets all study linux!!! :study:


All times are GMT -5. The time now is 11:53 AM.