On PC, the extra network adapter is configured as static 192.168.2.1.

A switch with DHCP enabled is connected to 192.168.2.1 and if I login using the console (RS232) I see that it has 169.254.x.x source: link-local, MAC: xx:xx:...

How would I be able to open an SSH connection with the device knowing only it's MAC adress? Do I need some DNS configuration?

  • My background in networking is very limited. :( – Alex Nov 8 at 14:17
  • I do not understand the question. Do you want to convert a MAC address into a link-local address, or are you looking for a physical device, or something else? – Ron Maupin Nov 8 at 14:22
  • I just need to login to the switch via SSH, do some operations, and then logout. – Alex Nov 8 at 14:23

On PC, the extra network adapter is configured as static 192.168.2.1.

A switch with DHCP enabled is connected to 192.168.2.1 and if I login using the console (RS232) I see that it has 169.254.x.x source: link-local, MAC: xx:xx:...

This means that these two cannot talk to each other - they're both part of different IP networks and there's no router in betweeen (which isn't possible because of the unroutable 169.254.x.y address).

If you've configured the switch as a DHCP client then your DHCP server isn't working. If you've configured the switch as a DHCP server then you will need to configure a static address.

How would I be able to open an SSH connection with the device knowing only it's MAC adress?

You can't. Either the PC needs to have an (additional) IP address within 169.254.0.0/16 or the switch needs to have an IP address within (assuming) 192.168.2.0/24. Alternatively, the switch could have another routable IP address and there's a router willing to forward in between.

Trying some ARP workaround (configure a static ARP entry on the PC like 192.168.2.2 for the switch's MAC) won't help because you'd get the switch to receive the frame and extract the IP packet, but since the destination IP isn't local it'd be ignored (a layer-3 switch would even try to forward the packet).

Do I need some DNS configuration?

DNS doesn't help here. DNS translates (human-readable) host names to IP addresses, but without the changes above there's no IP connectivity.

How to find the switch IP address based on MAC address?

There's no standard way. Historically, there's Reverse ARP but nobody's using that. You could try to listen to LLDP (Link-Layer Discovery Protocol) or CDP (Cisco Discovery Protocol) frames, advertising the switch and its IP address on its ports (when activated). There are also some other, proprietary protocols around but LLDP and CDP are more common.

IPv4 link-local addresses are randomly chosen by a device, then a check is performed to see if another device on the LAN has the same address (Duplicate Address Detection). See RFC 3927, Dynamic Configuration of IPv4 Link-Local Addresses:

2.1. Link-Local Address Selection

When a host wishes to configure an IPv4 Link-Local address, it selects an address using a pseudo-random number generator with a uniform distribution in the range from 169.254.1.0 to 169.254.254.255 inclusive.

The IPv4 prefix 169.254/16 is registered with the IANA for this purpose. The first 256 and last 256 addresses in the 169.254/16 prefix are reserved for future use and MUST NOT be selected by a host using this dynamic configuration mechanism.

The pseudo-random number generation algorithm MUST be chosen so that different hosts do not generate the same sequence of numbers. If the host has access to persistent information that is different for each host, such as its IEEE 802 MAC address, then the pseudo-random number generator SHOULD be seeded using a value derived from this information. This means that even without using any other persistent storage, a host will usually select the same IPv4 Link-Local address each time it is booted, which can be convenient for debugging and other operational reasons. Seeding the pseudo-random number generator using the real-time clock or any other information which is (or may be) identical in every host is NOT suitable for this purpose, because a group of hosts that are all powered on at the same time might then all generate the same sequence, resulting in a never- ending series of conflicts as the hosts move in lock-step through exactly the same pseudo-random sequence, conflicting on every address they probe.

Hosts that are equipped with persistent storage MAY, for each interface, record the IPv4 address they have selected. On booting, hosts with a previously recorded address SHOULD use that address as their first candidate when probing. This increases the stability of addresses. For example, if a group of hosts are powered off at night, then when they are powered on the next morning they will all resume using the same addresses, instead of picking different addresses and potentially having to resolve conflicts that arise.

If other devices are on the same LAN when the DAD is performed, the other devices should update their ARP tables, relating the IPv4 address to the MAC address, and you could look in the ARP table of one of those other devices.

If the address is chosen when no other devices are on the same LAN, or the ARP tables of the other devices have timed out, then you do not have a way to relate the IPv4 link-local and MAC addresses.

  • Windows uses the MAC address to calculate the LL address. – Ron Trunk Nov 8 at 14:43
  • Is the switch running Windows? – Ron Maupin Nov 8 at 14:44
  • I have no idea. I was just adding a little more info on how some devices chose the address. – Ron Trunk Nov 8 at 14:50
  • @RonTrunk, the interesting part of that is that Microsoft was the primary author of the RFC. – Ron Maupin Nov 8 at 14:53
  • The switch is running linux. – Alex Nov 8 at 14:54

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.