You can not connect by MAC
- although you could use MAC
to resolve IP.
You DO NOT need to know the IP address to connect to your Pi.
You can just connect to your server by name e.g. raspberrypi.local
instead of IP address.
(NOTE raspberrypi is the default hostname, and can/should be changed).
You can easily connect from Linux and OS X with ssh pi@hostname.local
(the default hostname is raspberrypi) This should work with popular GUI ssh programs. This is sometimes problematic with some versions of Windows and networks which use .local in a non-standard way. (See https://en.wikipedia.org/wiki/.local)
NOTE .local resolution does not always work e.g. in rsync. The following should resolve IP (and can be included in bash scripts)
RemotePi=$(getent hosts hostname.local | awk '{ print $1 }')
If you REALLY want to know the IP address you can discover it by many means;
arp raspberrypi.local
on most networks (arp raspberrypi
may work on some)
e.g.
arp archpi.local
archpi.local (10.1.1.20) -- no entry
or
getent hosts archpi.local | awk '{ print $1 }'
10.1.1.20
or
ping -c 1 archpi.local
PING archpi.local (10.1.1.20): 56 data bytes
64 bytes from 10.1.1.20: icmp_seq=0 ttl=64 time=4.607 ms
ssh pi@raspberrypi.local
whereraspberrypi
is the hostname of your PiZW courtesy of the Avahi daemon and mDNS? https://www.raspberrypi.org/documentation/remote-access/ip-address.md – Roger Jones Apr 06 '19 at 16:12raspberrypy.local
is reserved for link-local addresses from 169.254.0.0/16. The RasPi has a private address so it cannot work. – Ingo Apr 06 '19 at 18:58ssh pi@raspberrypi.local
– Pedro Rout Apr 06 '19 at 23:52