LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Routing IP Packet from user Application using rawsocket (https://www.linuxquestions.org/questions/linux-networking-3/routing-ip-packet-from-user-application-using-rawsocket-731830/)

johnniealan 06-09-2009 11:33 PM

Routing IP Packet from user Application using rawsocket
 
hi all,

I am using Rawsockets for writing the IP packets to the network. But the packet which i write is loop backed again to the filter input. Any ideas or pointer will be useful.

My requirement is to route the IP packets written in raw sockets to another machine using the eth0 device

RAW SOCKET <---> eth0(10.66.67.208) <----> machine2 (10.66.67.220)

I have written a small program to test the above description. The packet which i write using the raw socket option is taken over by the loop back device. How do I route the packet via eth0.

my eth0 ip is 10.66.67.208

I tried using ip tables
Code:

iptables -t mangle -I POSTROUTING -o eth0 -j ACCEPT
I tried using ip rules -
Code:

ip rule add to 10.66.67.220 lookup 7
ip route add default dev eth0 table 7

nothing worked out


Please help me in this regard

Alan J


All times are GMT -5. The time now is 10:15 PM.