Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-26-2007, 02:21 AM   #1
LQ Newbie
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
Capturing, modifying and injecting packets

Hi all,
I want to capture packets which are being sent by an application from my own machine and i want to capture them before they actually go to wire. What i want to do like ...i want to capture the Ipv4 packet sent by my applications to some special address ( like some subnet ) and drop the packet from being sent on wire. Then modify that to Ipv6 packet ( by doing some map Ipv4 -> Ipv6) and Then put the modified Ipv6 packet into the kernel queue ...for routing stuff.
Currently, I tried with Raw-sockets with 'PF_PACKET' flag but that doesn't work out. By Raw-sockets, I am actually able to capture packets which are on the wire but not which i was intend to capture ?

Any help would be appreciated !

thanks in advance,
Old 07-03-2007, 07:27 AM   #2
LQ Newbie
Registered: Jun 2007
Posts: 2

Original Poster
Rep: Reputation: 0
okk, i am able to capture packet by libpcap interface. but the problem i am facing now is that i am only able to send packet directly on the wire. but i want the packet to be send such that it goes through kernel. any idea, how can put modified packet to kernel networking stack queue ???
-- flukebox
Old 07-03-2007, 08:07 AM   #3
LQ Newbie
Registered: Mar 2007
Posts: 8

Rep: Reputation: 0
hmm... I think iptables can come in handy for your problem, though I don't know the exact filters/mangle you may need to write.

ip6tables will capture packets and modify them and put them back to the kernel Q.


hack, kernel, packet

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Injecting packets ...sockets?? bhupeshchawda Linux - Networking 0 03-24-2007 11:31 PM
Capturing a Socket and Injecting a Packet Chryzmo Programming 5 12-07-2005 01:17 AM
Capturing packets from my WAN/Router {O_o} Linux - Security 4 10-12-2005 04:56 PM
VoIP Packets capturing in linux fastian Linux - Networking 1 03-25-2005 11:34 AM
capturing ethernet packets shrike_912 Programming 5 08-02-2004 01:46 PM

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration