I want to connect to hotspot on my phone automatically when I boot my Raspberry Pi 4 (with Kali Linux installed).
I know that I can edit /etc/network/interfaces but the configuration file I have is something like this:
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.198
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.1.255
gateway 192.168.0.1
wpa-ssid "WIFINAME"
wpa-psk "WIFIPASSWD"
which is great if the hotspot had a static IP address but my phone changes the third part of the IP address 192.168.THIS_PART.1 every time I open the hotspot.
How can set the last part of the IP address to be always the same in the configuration file but also have the third part changed so I can connect with ssh to my RP4.
I'm not limited to using the /etc/network/interfaces configuration file.