dimanche 20 avril 2014

Packet forwarding in *nix


Vote count:

0




I am trying to write a python application which does the following:


1.recieve packet(say pkt1) from say eth0 from network a.b.c.d 2. parse/process the packet (prspkt1) 3. check the dstip(q.w.e.r) in routing table and forward the packet through say a different interface eth1


I am trying to evaluate different options of achieving step 3


1.using loopback interfaces, Can I send the packet(prspkt1) to loopback interface and let kernel IP module perform step 3 ?


I understand that sending packets to loopback interfaces , puts the packet on the Kernel IP module, but I am unsure if the Kernel would read/process packets from a loopback interface.


Another approach what I have been considering is ,reading the routing table, establishing a socket session to the outgoing interface eth1 and send the packet (prspkt1) through the interface without using loopback interfaces.



asked 47 secs ago






Aucun commentaire:

Enregistrer un commentaire