* kernel module acquiring virtual ip's
@ 2006-04-18 10:14 Sachin Shelar
0 siblings, 0 replies; 2+ messages in thread
From: Sachin Shelar @ 2006-04-18 10:14 UTC (permalink / raw)
To: linux-kernel
Hi,
I have a kernel module which "acquires" virtual ips ( not assigned to
anyone in n/w )
and then respond to any future packets coming to this virtual ip.
I am handling ARP, TCP, UDP protocols in my module.
To get the arp stuff working I handle all the ARP requests for virtual IP
and reply to
them with my local hardware address. I can now receive all the packets
destined to virtual IP.
E.g Local IP is 192.168.1.2
Virtual ip is 192.168.1.244 ( Not existing in network )
I catch every arp request for .244 and reply with my mac. I can now
recive all IP packets ( handled in my netfilter hooks ) destined for .244.
According to the natting rules in my module I nat the packets for .244 and
redirect them to
some listening port on 192.168.1.2
Also I handle all the outgoing packet from 192.168.1.2 and replace the
source to 192.168.1.244
So that the client machine recives reply from virual IP, as expected.
192.168.1.21[32774] -> 192.168.1.244[123]
Nat Destination 192.168.1.21[32774] ->
192.168.1.2[23]
(Reply) 192.168.1.2[23] -> 192.168.1.21[32774]
Nat Source 192.168.1.244[123] ->
192.168.1.21[32774].
Module works perfectly and I can establish any tcp connection ( E.g
telnet ) with a non exitsing
IP ( 192.168.1.244) from any machine in the network.
Problem is :-
I want the same behaviour from the module if I try to connect from the
same machine (local machine )
to the virtual IP.
E.g 192.168.1.2[32772] -> 192.168.1.244[123]
Nat Destination 192.168.1.2[32772] ->
192.168.1.2[23]
***** But somehow this packet after natting is dropped be the kernel and
never reaches 192.168.1.2[23]
Is this because the source and destination ip of this packet is same
?????
Hoping to get good reponse for this loooong mail :)
Thanks,
Sachin
^ permalink raw reply [flat|nested] 2+ messages in thread
* kernel module acquiring virtual ip's
@ 2006-04-27 9:04 Sachin Shelar
0 siblings, 0 replies; 2+ messages in thread
From: Sachin Shelar @ 2006-04-27 9:04 UTC (permalink / raw)
To: netfilter-devel
Hi,
I have a kernel module which "acquires" virtual ips ( not assigned to
anyone in n/w )
and then respond to any future packets coming to this virtual ip.
I am handling ARP, TCP, UDP protocols in my module.
To get the arp stuff working I handle all the ARP requests for virtual IP
and reply to
them with my local hardware address. I can now receive all the packets
destined to virtual IP.
E.g Local IP is 192.168.1.2
Virtual ip is 192.168.1.244 ( Not existing in network )
I catch every arp request for .244 and reply with my mac. I can now
recive all IP packets ( handled in my netfilter hooks ) destined for .244.
According to the natting rules in my module I nat the packets for .244
and redirect them to
some listening port on 192.168.1.2
Also I handle all the outgoing packet from 192.168.1.2 and replace the
source to 192.168.1.244
So that the client machine recives reply from virual IP, as expected.
192.168.1.21[32774] -> 192.168.1.244[123]
Nat Destination 192.168.1.21[32774] ->
192.168.1.2[23]
(Reply) 192.168.1.2[23] -> 192.168.1.21[32774]
Nat Source 192.168.1.244[123] ->
192.168.1.21[32774].
Module works perfectly and I can establish any tcp connection ( E.g
telnet ) with a
non exitsing IP ( 192.168.1.244) from any machine in the network.
Problem is :-
===========
I want the same behaviour from the module if I try to connect from the
same machine (local machine )
to the virtual IP.
E.g 192.168.1.2[32772] -> 192.168.1.244[123]
Nat Destination 192.168.1.2[32772] ->
192.168.1.2[23]
***** But somehow this packet after natting is dropped by the kernel and
never reaches
192.168.1.2[23]
Is this because the source and destination ip of this packet is
same ?????
Whats the solution for sending a packet with local ip as its src and
dst
to local from POSTROUTING hook
Thanks,
Sachin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-27 9:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 9:04 kernel module acquiring virtual ip's Sachin Shelar
-- strict thread matches above, loose matches on Subject: below --
2006-04-18 10:14 Sachin Shelar
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.