Hello,
I have a question linked to the local delivery of packets for Linux Kernel. My question is linked to network features.
I've two ethernet interfaces (eth0 and eth1), I want to send a packet from eth0 to eth1 and force it to be routed on the LAN network by a router or another computer. (as shown below)
On the computer 2, I've launched wireshark and a simple C program which listen on a UDP port and redirect the UDP message to another Ip address (simple ip redirection)
Code:
+++++++++++
+ ===== + Msg +++++++++++
+ Eth0 -------------------->---- +
+ ===== + + | +
+ + + | +
+ ===== + + | +
+ Eth1 --------------------<---- +
+ ===== + LAN Network +++++++++++
+++++++++++ Computer 2
Computer 1
According to my understanding, when the linux kernel sees that the packet sended by eth0 is destinated to eth1. The packet is routed through the local network and not on the LAN network.
Is it possible to force the Linux Kernel to send it on the "outside" network? If yes, how can I do it?
After reading Linux network architecture articles on google, I've thought to modify the ip_rcv / ip_route_input functions in order to force it to go on the LAN Network.
Thanks for your help.