LinuxQuestions.org
Help answer threads with 0 replies.
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 11-07-2006, 01:23 PM   #1
kar_the_terrible
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Rep: Reputation: 0
Redirecting traffic to eth0/eth1


This is more of a network programming question, but I couldnt find the appropriate forum.

I would like to send a packet, for now lets say a ping packet through a specific interface. I know that the ping program supports this. What I want to know is how to set it up in my own source code, so that I can send a packet through eth0 or eth1 depending on what my code chooses.

Do I set it up at the socket level, or when I'm assembling the packet header?

Currently I'm at a loss to find source code samples on the net.

Any help is appreciated, thanks.
 
Old 11-08-2006, 04:21 AM   #2
ele0100443
LQ Newbie
 
Registered: Oct 2006
Location: Sokoto, Nigeria
Distribution: RedHat, Mandrake
Posts: 15

Rep: Reputation: 0
I think you have to understand your firewall before you can do this
Quote:
Originally Posted by kar_the_terrible
This is more of a network programming question, but I couldnt find the appropriate forum.

I would like to send a packet, for now lets say a ping packet through a specific interface. I know that the ping program supports this. What I want to know is how to set it up in my own source code, so that I can send a packet through eth0 or eth1 depending on what my code chooses.

Do I set it up at the socket level, or when I'm assembling the packet header?

Currently I'm at a loss to find source code samples on the net.

Any help is appreciated, thanks.
 
Old 11-08-2006, 08:26 AM   #3
kar_the_terrible
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Original Poster
Rep: Reputation: 0
There is no firewall, or any other network filtering/monitoring software. Its an embedded system on an XScale processor, running a barebones install. I could solve the problem by assigning a static IP address to each interface as long as each is on a different subnet, but I dont want to have that constraint.

Now, ping or dhclient for example allows me to pick the interface. I would like to have similar functionality in a custom app: streaming video over UDP. I'm currently going over the dhclient source code.

Hope that clarifies things.
 
  


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
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM
redirecting vpn traffic brb5548 Linux - Networking 1 07-01-2003 01:13 PM


All times are GMT -5. The time now is 03:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration