Thread: Con you bind a Mac address?

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    23

    Con you bind a Mac address?

    Hi,

    I have a server and two clients that i use to measure for example the round trip time. The server is an individual computer with an IP= 192.168.0.4 and the clients are in the same computer, so i have one computer with two ethernet cards :
    eth0 192.168.0.2
    eth1 192.168.0.3

    I am sending packets from .2 to .3 via the server and viceversa. So, each client has a receiver and a sender. Programming the sockets, i bind one of the clients to .2 and the other .3 in both the sender and receiver hoping that this will make the computer two use the rigt ethernet card.

    Unfortunately by looking at wireshark i realise that i am sending packets from the same ethernet card , that is, wireshark shows different IPs (as expected from binding the sockets) but the MAC address is alwasy the same.

    I have a look to the routing table by netstat -nr and indeed i understand what is happening, the routing table says

    Destination | Gateway | Mask | ... Interface
    192.168.0.0 0.0.0.0 255.255.255.0 eth0
    192.168.0.0 0.0.0.0 255.255.255.0 eth2

    So all packets routed to the server are going through eth0. How can i make use of eth2??? any ideas how to program to bind to a MAC address rather than IP address??

    Thanks

  2. #2
    Registered User
    Join Date
    Aug 2010
    Posts
    23
    As i thought this is kind of a silly question.

    Just in case anybody gets to the same point as me, I found a solution by adding a second ethernet card to the destination (server) and adding some route entrance to the routing table.

    So as to programing in C itself still the same.

    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to Send Mac Address From Client to Server
    By Lieyza197 in forum C Programming
    Replies: 2
    Last Post: 05-27-2009, 09:58 AM
  2. What does this do (Windows API)?
    By EVOEx in forum Windows Programming
    Replies: 4
    Last Post: 12-19-2008, 10:48 AM
  3. Spoof MAC Address.
    By eXeCuTeR in forum C Programming
    Replies: 10
    Last Post: 02-07-2008, 05:35 PM
  4. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 07:17 PM
  5. Im so lost at . .
    By hermit in forum C Programming
    Replies: 18
    Last Post: 05-15-2002, 01:26 AM