Is there a way to get a remote (next hop) mac address with only knowing local interface name through with I will be sending traffic?
What I mean is: I have two computers interconnected, each have e.g. 4 network interfaces 2 of them are connected (one computer to another), now I know that on the first computer I will use eth0 and I assign an IP to it. Now I would like to get the mac address of the other end (network interface on second computer), is there a way to do this?
My idea is to just send something on the wire and get the other end to response with mac address. Is it possible somehow?
Explanation:
I have two computers connected by a wire
Those computers are running linux, there is no network manager, network interfaces are managed statically
On computer A I configure an interface ethA to have an IP and take it up (ifconfig ethA IP up)
On computer B i dont configure anything, but i take up every interface
Now the question: I want to detect from computer A to which interface on computer B is network interface ethA (on computer A) connected and get its mac address. Meaning the wire connects two interfaces so the only think I need is to just use that wire and send something to it which will get me the remote interface MAC.
To explain why I need this:
We have a lot of servers and those server has a lot of interfaces (4 - 10) and one interface is used for ssh to those servers and the others interfaces are for connecting one server to another so there are 2,3,4 lines between a pair of servers and because we need to automate our tests we need to know which interface is connected to which - we actually need the interface name, not mac, because the name is one of parameters to our application which we develop.
Thanks