LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2007, 04:23 AM   #1
chamithranaweera
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Rep: Reputation: 0
IP packet forwarding


Is there any method to forward network(IP)packets using pcap.h header file .We are using libpcap and tcpdump Is there any method to do it or do we need to use another tool instead of libpcap.
 
Old 02-27-2007, 04:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
well firstly a header is just a list of function names and variable. it doesn't do a single thing. if you wish to actually utilize libpcap as a whole, then that is, as the name suggest, for packet capture, not forwarding.
 
Old 02-28-2007, 03:40 AM   #3
chamithranaweera
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Unhappy

Well thank you for the details.
Do I need to use onather method to packet capturing
But how a linux machine would do it?I thought it was pcap.h file have necessory functions.
Please can you show me the way to do packet capturing.I really need to do it.
 
Old 02-28-2007, 03:54 AM   #4
vishamr2000
Member
 
Registered: Aug 2004
Posts: 210

Rep: Reputation: 31
Hi there,

U can intergrate both sniffer and packet sending capability in a program. Or u can have separate programs - one for sending packets and one for sniffing. U can pass the packets captured and then pass then to the packet sending program (using sockets).

If you are only interested in packet forwarding, you can use IPTables that can redirect your traffic to another PC or network. There is also Ebtables (dnat target)..it depends on wat you are trying to do. Provide more details if u can..

Warm regards,
Visham

Last edited by vishamr2000; 02-28-2007 at 04:00 AM.
 
Old 03-01-2007, 03:42 AM   #5
chamithranaweera
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Unhappy

Hi there,

Plz can you give me some examples how to do this thing? or can you give me some codes that do the forwording(capturing and forwording)
plz help me I am structed in my program.
 
Old 03-02-2007, 01:07 AM   #6
vishamr2000
Member
 
Registered: Aug 2004
Posts: 210

Rep: Reputation: 31
pcap for capturing:
http://reactor-core.org/libpcap-tutorial.html
http://www.tcpdump.org/pcap.htm
http://yuba.stanford.edu/~casado/pcap/section1.html

For socket programming:
Look for Beej's Guide

For the forwarding part, you'll have to provide some more info as I dont know the system you're putting in place or what you are trying to achieve. The solution will depend on what you want to achieve

Warm regards,
Visham
 
Old 03-06-2007, 03:09 AM   #7
chamithranaweera
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Hi there,
thank you for the infomation.it is really worth.
Actually we design a software router using Linux operating systems besides the kernel routing method in Linux.

We are using Red hat Linux Enterprise edition 4.0 as our core operating system.

Actually we struck in the forwarding part.So plz help us to get on with the frowarding part.
 
  


Reply


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
packet forwarding? one.eleven Linux - Networking 19 11-08-2006 03:35 AM
packet fragmentation in packet forwarding code cranium2004 Linux - Networking 0 05-16-2005 04:05 AM
could i ask a question about forwarding a packet mostafa_ezz Linux - Networking 0 02-07-2004 02:05 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
kernel packet forwarding doodah Linux - Networking 4 08-17-2001 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:22 PM.

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