How to obtain 'static' IP when USB tethering?

I'm tethering laptop<->Android for purposes of IP tunneling/VNC.

Because the laptop obtains a random IP in the 192.168.42.* range each tether, I must manually enter this for the tunnel each time the tether is established.

This is less than ideal. Is it possible to have Android assign a consistent (that is, not random) address to each tether?

TIA.


Solution 1:

Assuming your Firewall is OFF (or properly configured), and your network is not set to Public, and if your connection works means it's all good.

  1. Having the phone connected and tethered, go to Network and Sharing Center and click on the Local Area connection "Connections:"

    screenshot

  2. On the next screen select Properties, then highlight IP 4 and press properties there and click "Use the following IP address"

  3. Put Default Gateway and Subnet Mask exactly as it was in the ipconfig, and for the IP Address, only change the last 3 digits to anything from 1 to 255 That IP will be your new fixed/static IP and it will remain the same even after you unplug the phone.

    screenshot

If your connection doesn't work, in other words you can't access server running on the computer, this will help: https://stackoverflow.com/questions/9887621/accessing-localhost-of-pc-from-usb-connected-android-mobile-device/42607979#42607979