Internet connection sharing over WIFI without modifying LAN adapter IP address

I have an Android phone (non-rooted Sony Ericsson ST15i) that I'd like to connect to the internet via my laptop's wired Ethernet connection (linked to my university network, that uses an authentication proxy to connect to the internet, with a fixed IP address assigned to every dorm room). This wired connection shows up on my system as the default "Local Area Connection".

I tried a few things for this:

  1. Virtual Router Manager - in order to get the Android phone to recognise the laptop as a WiFi hotspot, since it can't connect to ad-hoc networks. But the application fails to connect giving me the error "Virtual Router could not be started".

  2. Internet connection sharing in Windows 7 - tried setting the "Wireless Network Connection" to share the internet connection from "Local Area Connection", but this gave me a popup saying that the LAN adapter will be set to the IP address 192.168.137.1 - which is different from the IP address assigned to my room.

Is there a way to make this work?

Thanks in advance!


Solution 1:

This can be done by setting up your windows machine as a very simple wireless access point, similar to the ad-hoc functionality, more difficult to set up but far more robust, i.e. any device that supports WiFi will be able to connect. It is known as 'hostednetwork' and uses the built-in Microsoft Virtual WiFi Adapter.

To set it up, bring up the elevated command prompt by pressing Win-key, typing cmd and hitting Ctrl-Shift-Enter. Then enter the following command:

netsh wlan set hostednetwork mode=allow "ssid=<ssid>" “key=<passphrase>” keyUsage=persistent

Most options are quite self-explanatory, but you can get more info using netsh wlan help. After executing this command, the hostednetwork will be stored permanently, but still needs to be started and stopped manually. You might want to create some sort of shortcut for the following commands:

netsh wlan start hostednetwork
netsh wlan stop hostednetwork

Note that these commands too must be run as admin.

At this point, a new item should have appeared in the 'network connections' section of the Windows network center. You can edit its properties, but the default settings should work just fine. Your phone should be able to detect the freshly made access point and connect to it, obtaining an IP-address in the 192.168.137.0/24 range. Don't worry though, this will not affect the wired connection on your computer, as they're both using different networks.

While a connection has been established, your pc will not allow machines on the wireless port to interface with any other ports and by extension, the internet. For this, you can use Internet Connection Sharing (ICS). Edit the properties of your wired interface, bring up the 'Sharing' tab, check the box to enable this feature and select the corresponding interface, the wireless AP that is. The interface is a bit buggy, you might need to revert, close the window and try again if you go wrong.

Voila, internet on your Android via your pc.