I am looking for help with static a IP address on WiFi. I have this project with Kali on a pi0w. I am using the pi-tail image as this is going to be mobile. I have the pi working great, it boots and logs in automatically. Moreover, it connects to the WiFi automatically. But my issue is, I want it to have the same IP address every time. It will connect to my iPhone's hotspot as the pi will be hidden in phone case, but I need it to have a static IP so that I can ssh to the pi headless. To do this, I need to know the IP address but can't get it (or can I?), so I figured a static IP would fix it as I will know every time when I turn it on to ssh to the same IP.

1 Answer 1


Option 1. You are asking for DHCP reservations. iPhone's hotspot does not provide this feature. But some routers do. You can use those router instead of iPhone's hotspot where you can bind Pi's mac address to a fixed IP.

Option 2. You can write an script to get the IP by networking scanning. Below is the command to help you start writing it. First collect your Pi's mac address.

nmap -sP >/dev/null && arp -an | grep <mac address here> | awk '{print $2}' | sed 's/[()]//g'
  • thanks. sound good. but im looking to do it on the go. so as i can turn on the pi and it will auto boot and connect to my iphone hotspot. the only issue then is trying to figure out what the ip is so i can hop on any computer, join the same hotspot and ssh into the pi(kali)
    – Dan
    Feb 27, 2019 at 11:13

You must log in to answer this question.