WTH: ip address - mac address

Why can’t I enter mac addresses of my devices in the configuration.yaml instead of ip addresses.
This to avoid regular updating of the configuration every time the router reboots, devices get plugged/unplugged, electricity falls out, … .

Maybe because a mac address can’t be chosen by homeassistant to communicate?

Meaning that connectivity is done on OSI layer 3/4 via TCP/IP. Ofcourse that uses layer 2 (where MAC addresses are present) but are not used very often other than e.g. WOL (Wake on Lan).

2 Likes

There might be things I’m missing but when I search for the ip-addresses of my devices I use the arp-scan tool which gives a list like this:

|192.168.0.xxx|aa:bb:cc:dd:ee:ff|Comtrend Corporation|
|192.168.0.xxx|gg:hh:jj:kk:ll:mm|Espressif Inc.|

So I would assume having some scanner option that maps an absolute address to an ip-address could work in a lot of cases.

1 Like

Because in IP network you can broadcast a message to network and ask what is MAC of this IP address. but not otherwise. To lookup IP from MAC address, you must scan all possible IP in your network to find the right MAC.

it ok to use arp-scan but if I use a very big address range for my local network from 10.0.0.0 – 10.255.255.255 (16.777.216 address) that would take tons of time to scan all of that IP every time HA want connect to something

1 Like

Just set static ip in router and you don’t have problem.

1 Like

Or you could try hostname instead of IP. use nslookup <ip_address> to find the hostname of device.

1 Like

Yes, this has been part of tcp/ip networking since I dunno when? Probably since darpanet!

Hostname is not part of tcp/ip :-). It’s part of DNS which runs over tcp/udp/ip :rofl:.

Maybe lock this WTF?

Sorry but in my opinion the time duration doesn’t create a blocking item.
Home assistant can still (internally) keep a list of ip-addresses (e.g. after doing a scan once or using an initial ip address provided in the configuration) and only perform a scan when it sees there is a conflict with a mac address.
Even if it takes long, it would still be better than having to update the configuration manually.

The router from my internet provider doesn’t allow me to do that …

1 Like

You are right of course. My point it still valid, hostname to ip address conversion has been with us for a very long time.

Then get another one.

pi-hole works very well as a DHCP and DNS server.

Are you sure about that?
Have you talked to your ISP about it?

My Arris SBG10 router requires both IP address and MAC address to set a reserved IP. I found the IP address on the HA startup screen, but cannot locate the MAC address. I have tried Fing, arp -a and an ip scanner tool but have not found the MAC address.
Any ideas?

A year old WTH topic is the wrong place to ask. A new topic would have been better.

Anyway, the mac address for what device?

I want to set the ip address (192.168.0.16) as static for my Home Assistant installation in VirtualBox on Win 10. The Arris router requires the MAC address to do that. I have not found the MAC using any of the tools mentioned here. I just tried nslookup with the following result:

C:\WINDOWS\system32>nslookup 192.168.0.16
Server: dns-cac-lb-01.rr.com
Address: 209.18.47.61

*** dns-cac-lb-01.rr.com can’t find 192.168.0.16: Non-existent domain

So you want to know the mac address of the virtual machine?

…go to to the network settings of the virtual machine. Go to the Network settings and click the Advanced arrow. Where it displays the MAC address…

Second post from the first Google result.

This is just me being pedantic, but I think it’s important to get the terminology right, since it can help you and others to find the right info: What you’re doing is called a DHCP reservation. A static IP is set on the host. A reservation has the same end result, but the mechanism is different.

1 Like

Oh, does that ever sound familiar.
It probably does, but it doesn’t call it “static IP”. (Because it isn’t).
My IP comes from Verizon FIOS, and I mistakenly believed the same until someone here educated me to the actual name of the option: permanent lease.

Thanks for the clarifications. This helped a lot.

1 Like

To be even more nitpicking, I wouldn’t agree with “the same end result” :wink:
DHCP reservation doesn’t ensure that IP will be fixed infinitely. In case of the reservation, the client has to ask DHCP for renewal. It’s common it does that twice during single lease time period. If DHCP doesn’t respond the device has to release this IP, usually falls-back to some predefined IP. Such situation renders in unavailable device (since this fall-back IP usually belongs to different subnet).

For static IPs, the device is available under its IP as long as it’s operational and network is not broken. Doesn’t matter what is happening to DHCP and other services in the network.