All of lore.kernel.org
 help / color / mirror / Atom feed
* netfilter reg problem
@ 2006-06-01  6:03 varun
  0 siblings, 0 replies; 2+ messages in thread
From: varun @ 2006-06-01  6:03 UTC (permalink / raw)
  To: netdev

Hi all,

            I have a setup where iam using iptables. I have squid 
running on my statem. Now the scenario is that this sytem is my router. 
I have eth0 connected to LAN, eth1 to Wan 1 and eth2 to Wan2. In the 
same box i also have a propratery FW which has Load Balancing feature.  
Now my intention is i start iptables first so that it registers with 
netfilter hook first.
So policy is like this
      iptables -t nat -D PREROUTING -i eth0 -p tcp -j REDIRECT --to-port 
8080
 In the port 8080 i have squid running.
 As far as filtering of iptables is concerned it is allow all.

     So my basic FW functionality is concerned it is taken care by My 
Propratery FW. It will do  the natting for both wan interfaces in Load 
balance.

  Now what i expect is that iptables will get all the packets first and 
then packet will go to my firewall and might get dropped if ACL matches 
else it is success. Once success i expect the packet to be redirected to 
port 8080 where squid can take control.

 Now my problem is that even though iptables is registered first when i 
log the packets using iptables for the above rule i find that no packets 
are comming to iptables there by no packets are going to proxy. I get 
only some multicast packets.

 From lan iam able to browse well and all my traffic is going tru my FW 
rather that first through iptables. Why?

As far as my knowledge first registered module get the packet first and 
if the action is NF_ACCEPT the the next registered module to the hook 
gets it right? If yes why is it not happening? Another thing is what 
exactly does redirect do does it mangel the packet?

Please help me in this?

Varun

^ permalink raw reply	[flat|nested] 2+ messages in thread
* Netfilter reg problem
@ 2006-06-09 12:35 varun
  0 siblings, 0 replies; 2+ messages in thread
From: varun @ 2006-06-09 12:35 UTC (permalink / raw)
  To: netfilter-devel

Hi all,

             I have a module which basically registers to the netfilter 
like shown below.
 
               static struct nf_hook_ops my_preroute_ops
= { { NULL, NULL }, my_Input, PF_INET, NF_IP_PRE_ROUTING, 
NF_IP_PRI_NAT_DST-1 };

              Now in this when i get a packet based on certain condition 
i use NF_STOLEN.

           Now the scenario is that i want to register iptables with 
REDIRECT facility also.
          The reason is that if i get a packet which has destination 
port 80 i will redirect to 5555 where i run squid proxy.
          so i use a policy like
         iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j 
REDIRECT --to-port 5555

          So for this to happen iptables should get the packet first 
before my module otherwise i will steal the packet and iptables will not 
get the packet.

         So i registered my module first and then try to insmod iptables 
modules. ip_conntrack.o refuses to insmod saying that resource busy. so 
without conntrck i cannot use REDIRECT. Why is this happening?

         Next if first register iptables and then my module then every 
thing works fine. But packets are not coming to iptables .
Only my modules get it. So how can i overcome this situation? How to 
change my module reg functionality to suit the scenario?
      The important thing is that once iptables hits on the above policy 
then my module should get the packet after iptables.
       Please help me.
       Iam working on 2.4 kernel
Varun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-09 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01  6:03 netfilter reg problem varun
  -- strict thread matches above, loose matches on Subject: below --
2006-06-09 12:35 Netfilter " varun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.