Skip to contentSkip to conversation

Howo to get IP_NF_NAT_LOCAL behavior back after kernel 2.6.10 ?

DISCUSSION Djalel Chefrour 2 participants 2 messages Jul 27, 2005 – Jul 29, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I want to redirect local http traffic to a transparent squid porxy running on the NAT box itself.

I've used :

# iptables -t nat -A OUTPUT -p tcp -m owner --uid-owner squid -j ACCEPT 
# iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 3128 

But this works no more with kernel 2.6.11 & later.

# iptables -t nat -L -v 
gives this
---------------------------------------------------------------------------------------------------
Chain PREROUTING (policy ACCEPT 2281 packets, 906K bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain POSTROUTING (policy ACCEPT 97012 packets, 5712K bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 97005 packets, 5712K bytes)

 pkts bytes target     prot opt in     out     source               destination 
    0     0 ACCEPT     tcp  --  any    any     anywhere            

anywhere OWNER UID match squid
0 0 REDIRECT tcp -- any any anywhere
anywhere tcp dpt:http redir ports 3128

Chain loc_dnat (0 references)
pkts bytes target prot opt in out source destination

Chain wlan0_masq (0 references)
pkts bytes target prot opt in out source destination

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

TIA,
Djalel

#1 lore raw
Quoted 5 lines

I want to redirect local http traffic to a transparent squid porxy running on the NAT box itself.

I've used :

Quoted 8 lines
# iptables -t nat -A OUTPUT -p tcp -m owner --uid-owner squid -j ACCEPT 
# iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 3128 

But this works no more with kernel 2.6.11 & later.

pkts bytes target     prot opt in     out     source               destination 
   0     0 ACCEPT     tcp  --  any    any     anywhere            

anywhere OWNER UID match squid

Looks like squid doesnot send any packets at all.

Jan Engelhardt