My friends, i have a openwrt connected to my mobile hotspot on android device, i usually prefer the static ip interface while connecting and in this way i can portforward BUT my phone usually changes the gateway ip and with static ip my internet goes down.
Setting dhcp client i avoid the internet issue BUT i cant make to work portfoward (my needs are basically a printer and kde connect), is there a way to make this works ?
Obs : I have unlimited data plan on the phone hence i keep using it to avoid need to pay another internet provider
So you want your phone to be able to connect to the PC through the OpenWrt router?
Why do you need the OpenWrt router in this situation? Seems like you could directly connect your PC directly to the phone and not have any additional complications.
But, all you need to do is set a port forward on your OpenWrt router for the port(s) necessary to the address of the PC. Set the PC with a static IP or a DHCP reservation so that the PC's address never changes on the 192.168.30.0/24 network.
Then, on the phone, you just use the address that you find on the wan of your OpenWrt router and OpenWrt will port forward accordingly.
i have other devices, that are connected by ethernet and dont have wifi , eg ip printer
i was able to do that and manage to work when the wan interface that connects to the phone was set to static, but as i explained, the phone router random changes the gateway, so i set the wan interface to be dhcp client, after setting it to dhcp client, port forwarding stops working .
I dont know if i need to do something extra to accomplish it, or if dhcp client is not compatible with port forwading. PC already static in both situations
If the phone always stays on the same subnet and it’s address is always the same, you can obviously set the router to a static ip so that it is predictable. However, there really isn’t anything you can do if the phone is changing its address or subnet.