In order to login into the Shell of the Raspberry Pi connected directly to my PC via a LAN Cable, I crafted this tutorial that involved a tedious process of editing the cmdline.txt file of the Raspberry Pi. This hack comes in very handy when there's no access to a Display Screen or no Router. Another advantage of this hack was that the Shell access on the Pi can be achieved without ever having to connect the Pi to a Display Screen/Router.
After the popularity of this hack, I wrote another tutorial that allowed to also Share WiFi from the Windows PC over to the Raspberry Pi. This has been very popular, though sometimes a big pain to get working with Win 8/10.
Last night, I stumbled upon a very easy technique of Sharing WiFi with the Pi without having to edit/modify anything within the Raspberry Pi. I've shared the process below.
0. Tested on Raspberry Pi 2 (Wheezy), Win 7
1. Open up the Network and Sharing Center and select the Change Adapter Setting link. You should see something like this:
The Local Area Connection is where the Raspberry Pi will eventually be connected to and the Wireless Network Connection is our PC's internal WiFi adapter.
Individually open up the Adapter Properties for both LAN and WiFi:
and make sure that the Obtain IP Automatically radio button is selected in the IPv4 settings:
2. Select the Local Area Connection and the Wireless Network Connection, and while keeping the Mouse pointed on the Wireless Network Connection, right click. You should see an option called Bridge Connections. Hit that and wait for a while. You'll see couple of Bridging prompts.
3. Once it successfully bridges, you should now see a new Network Bridge created and also Bridge showing in the Network adapter:
4. Now, connect one end of a simple LAN/RJ45 Cable to the Ethernet Female port on the Raspberry Pi and the other end to the PC's Ethernet Female port. (Make sure that any existing network settings made on the Pi or Static IP modifications done in the network hosts on the Pi are restored to default settings)
5. Power ON the Raspberry Pi and wait for a minute or two. You should now see the Local Area Connection adapter also showing the Bridged info in the description.
6. Determine the Gateway IP (and dynamic IP ) assigned by the Router to the PC. This will then help us search for the Raspberry Pi's dynamic IP in the same subnet.
As seen above, the Default Gateway's IP is 192.168.0.1 and the IP assigned to the PC is 192.168.0.104. A dynamic IP assigned to the Pi will be anything between 192.168.0.2 to 192.168.0.255.
7. In order to find out the dynamic IP assigned to the Pi, use Advanced IP Scanner to search for all active Network Clients withing the IP range 192.168.0.2 to 192.168.0.255
My search results show the Pi's dynamic IP as 192.168.0.4
8. Now, simply fire up Putty and connect to the Pi:
9. Ping www.google.com or use wget to check for Internet Access
10. Voila! You've successfully bridged and shared WiFi from the PC to the Raspberry Pi using a simple LAN cable.
Notes:
1. I noticed a strange behavior: The network status indicator bar on bottom right would show as not connected when this method is activated, though Internet works as usual on PC.
2. Recommended to delete the newly created Network Bridge when not sharing. Had occasional network issues (WiFi on PC continuously searching for an AP to connect)
If this doesn't work for you, you can always try the good ol method explained here.
You can leave a comment below if it works for you and mention which Pi, Pi OS (Jessie/Wheezy) and Win OS version that worked for you so that it will benefit others. If it didn't work for you, leave a comment and I'll debug it.
Comments