You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Android 10 if I am not wrong hotspot IP address gets randomized, and I was thinking it would be amazing if I could set it to something more static like 192.168.45.1 using VPNHotspot.
I currently do this using a script:
#!/system/bin/sh
NEW_SUBNET='192.168.45'
WIFI_INTERFACE='wlan0'
WIFI_INTERFACE_INFO=$(ip addr show dev ${WIFI_INTERFACE}| grep -m1 "$WIFI_INTERFACE:")if [[ "$WIFI_INTERFACE_INFO"==*"state UP"* ]];then
LOCAL_TABLE=$(awk '$2=="local_network" {print $1}' /data/misc/net/rt_tables)
ip route replace ${NEW_SUBNET}.0/24 dev ${WIFI_INTERFACE} table $LOCAL_TABLE
ip address replace ${NEW_SUBNET}.1/24 brd + dev ${WIFI_INTERFACE}
IPADDR=$(ip addr show dev $WIFI_INTERFACE| awk -F '[ /\t]+''$2=="inet"{print $3; exit}')
IPROUTE=$(echo $IPADDR| grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')if [[ "$IPROUTE"!=*"$NEW_SUBNET"* ]];thenecho"$IPROUTE.0/24"
ip route del ${IPROUTE}.0/24
echo"$IPADDR/24"
ip addr del ${IPADDR}/24 dev ${WIFI_INTERFACE}fi
ndc interface clearaddrs ${WIFI_INTERFACE}
ndc interface setcfg ${WIFI_INTERFACE}${NEW_SUBNET}.1 24 up
ndc network route add 99 ${WIFI_INTERFACE}${NEW_SUBNET}.0/24
exit 0
elseecho"$WIFI_INTERFACE is DOWN!!!"exit 0
fi
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Since Android 10 if I am not wrong hotspot IP address gets randomized, and I was thinking it would be amazing if I could set it to something more static like 192.168.45.1 using VPNHotspot.
I currently do this using a script:
Beta Was this translation helpful? Give feedback.
All reactions