Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Can we send packet from one interface to another that are on the same machine?


    I am trying to make loopback driver for linux 2.4.20. For this I made two network interfaces that are logical and not bound to any hardware. They both have to run on the same machine.

    And what I am doing in each driver is : when a packet comes on one interface change the destination address to that of the other network interface IP address. I am giving more details on this:

    applications : udp_client udp_server
    two interfaces : mydev0 mydev1
    IP addr :

    A packet from udp_client is send with "destination address":
    This packet automatically goes to mydev0 so "Source address":

    Now when this packet is recvd at mydev0 it change the "Dest Address":
    "Source Addr" :

    This way the packet reaches from udp_cli to udp_srv.

    Packet from udp_srv to udp_cli is also changed and send as defined above.Up till now everything is clear....

    Problem: When I change the source IP address to one of the IP addresses assigned to network interfaces the packet is dropped and does not reach to the other end.
    But when I assign packet any arbitrary IP_address other than that of any of the machine's interfaces this does work.

    I am not getting why the packet is dropped when the source IP address of the packet is changed to that of one of the network interface IP adresses.
    And also what is martian source or martian destination?

  2. #2
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    The packet is dropped by the kernel... .It considers the packet as a spoofed one when itz source address is changed to any one of the ip addresses on the same system.
    (please someone correct me, if i am wrong )

    A Martian packet is considered to be a packet with ambiguous source/destination...

  3. #3
    Thanx Cyberinstru...I was also thinking on the same line but I was not having any proof of your reply I am now sure for this..

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts