Sie sind auf Seite 1von 15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Syed Anwaarullah
Debugging Life, Simulating Experiences, Looping Output!

Sharing WiFi Internet connection


with Raspberry Pi through
LAN/Ethernet (HeadlessMode)

After having setup the Raspberry Pi to work in headless mode directly


without installing anything on it as described in this post, we then tinkered
on to share WiFi internet connection with the Raspberry Pi through the
LAN/Ethernet connection which we established in our earlier post.

What you want to do:

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

1/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

1. Share PC/Laptops WiFi internet connection with Raspberry Pi through


LAN/Ethernet connected to Raspberry Pi
What you have:
1. Raspberry Pi A+/B/B+/Pi 2 (If youve a Pi Zero, please try and let us know
if this works on a Zero) running the latest Raspbian Wheezy. (Ive not
yet tried it with recently released Raspbian Jessie based off Debian 8. If
youve been successful with this latest release, please post in the
comment and Ill update it here. Thanks.)
2. PC/Laptop with WiFi Internet connection and a Ethernet Jack (LAN
Connector / RJ45)
3. A working SSH connection with Raspberry Pi (direct access, explained
here)
What you dont have:
1. Display Device for the Raspberry Pi (HDMI enabled display unit / Old TV)
2. Direct Internet connection for the Raspberry Pi (LAN or WiFi)
Extra Stuff you need:
1. Standard Network Cable (Cat 5, Standard or Crossover)
2. PutTTY Software (will be used to SSH into the Pi)
3. SD Card Writer
Edit: 2nd Jan, 2015. Added Video Tutorial:

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

2/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Sharing WiFi with Raspberry Pi through LAN Cable

A large part of this post assumes youve read the earlier post on directly
accessing the shell on Raspberry Pi through a Ethernet/LAN connection. In
this post, well go about setting up the Raspberry Pi to access internet
through the Ras-Pis Ethernet/LAN port from a Laptop/PCs shared WiFi
connection.
Steps:

1. Firstly, enable the WiFi adapter of the PC/Laptop and make sure its
connected to a WiFi hotpspot. Open any Internet Browser and confirm
internet access by opening any website.

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

3/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Note: Im using my Android device (Nexus One) configured as a WiFi


hotspot J
2. Now, go to Network and Sharing Center (Network Settings in Win XP)
and then head to the Change Adapter Settings page. As shown below,
were connected to Wireless Network Connection on Android 4. Do
remember the Local Area Connection to which well eventually share
this connection

3. Now, right click the above Network Properties and then select the
Sharing tab
https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

4/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

4. From the drop down list, choose Local Area Connection and enable
both the checkboxes and hit OK. Once done, head back to the Adapter
Settings page and you should now see the Shared info message on the
Wireless Network Connection

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

5/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

5. Now, right click Local Area Connection Properties and then select
Internet Protocol Version 4 and then click the Properties Button

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

6/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Once the properties tab pops up, make sure that the Obtain IP address
automatically checkbox is selected. If not, check it and hit OK

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

7/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

6. Now, power up the Raspberry Pi (making sure that the Ras-Pi and the
Laptop/PC are connected to each other through the LAN/Ethernet cable)
and wait a minute or two while the Ras-Pi boots. Now, repeat step 5
(previous one) to make sure Obtain IP Address Automatically is still
checked.
7. Open up command prompt using the hotkey Windows Key + R and then
typing in cmd or simply keying in cmd in the start menu (Win 7)
8. In the command prompt, key in ipconfig and scroll to the top of the info
shown

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

8/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Note the IPv4 address which is 169.254.39.68 in this example. Please make
a note of what you see as this will be required further.
9. Now, power off the Raspberry Pi and plug the Ras-Pis SD card into a
card reader and connect it to the PC. Once the disk opens up, open the
cmdline.txt file in any editor

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

9/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Youd probably have an entry as ip=169.254.39.71 which we set up in our


previous post
10. Now, to this entry, append the IPv4 which we got earlier preceded by two
colons as shown below:

where the first half is the static IP for Raspberry Pi (169.254.39.71) and the
other half is the IP of the IPV4 or Ethernet Adapter (169.254.39.68) which
we obtained earlier.
11. Save this file and plug the SD card back into the Raspberry Pi. Power up
the Raspberry Pi and wait for a min or two. Establishg a direct SSH
connection with the Raspberry Pi as explained in the previous post.
12. Now, to verify if our Ras-Pi is Internet-Connected, type in this
command in the Shell (PuTTY terminal connected to the Ras-Pi)
ping http://www.google.com
and you should see response from the servers as shown below:

Voila!!! Your Raspberry Pi is now connected to the World Wide Web


13. Going one step further, lets direct access the Raspberry Pis desktop and
https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

10/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

open up the midori browser. Verify Internet connectivity on the Ras-Pi


by opening any website.

Note (Edited: 5th Feb, 2015): Midori browser is no longer coming preinstalled with the latest Raspbian version and has been replaced with
Epiphany Browser. Please use that instead to verify internet
connectivity.
Please let me your feedback or questions through comments.
Thanks
References:
1. http://pihw.wordpress.com/guides/direct-network-connection/supereasy-direct-network-connection/
2. https://anwaarullah.wordpress.com/2013/07/16/direct-accessraspberry-pi-shell-and-desktop/
P.S: Did this post help you? Please leave your feedback. If youve tried some
additional steps that helped you in getting this working, please share so we
all can benefit from.
https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

11/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

If youve benefited from this post, please consider donating and help me
buy new development stuff and resources. Thanks!

About these ads

YouMayLike

1.
15Star
Wars'ThingsYouNeverKnewYou
Needed2monthsago
huffingtonpost.comHuffingtonPost
AOLForexElanaTeitelbaumElana
Teitelbaum(sponsored)

Rate this:

1 Vote

Share this:

Twitter

Facebook

23

Email

LinkedIn

Print

Like
2bloggerslikethis.

Related:

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

12/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Direct Access Raspberry Pi Shell and Desktop on Laptop/PC without installing anything on
the Raspberry Pi OS or connecting it to a Display Unit
In "Raspberry Pi"

Internet of Things framework for the Raspberry Pi


For a start, one of the primary reasons for me to start a blog was to share those many links
which otherwise I'd bookmark and lose track of them when I actually needed something.
Secondly, I make notes in many mediums and maintaining and indexing them all was getting
troublesome
In "Raspberry Pi"

Buying Raspberry Pi 2 in India, Hyderabad


In "Raspberry Pi"

Author: Anwaarullah
Consultant Engineer, Designer, Developer, Maker, Speaker, Educator and
Dreamer. Tinkering with Embedded, Android, Open Soft/Hard/Firm ware,
Robotics and 3D Printer. Talk to me at syed {Shift+2} anwaarullah dash com
View all posts by Anwaarullah

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

13/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

Anwaarullah / August 12, 2013 / Linux, Raspberry Pi / Raspberry Pi, Sharing, WiFi

148 thoughts on Sharing WiFi Internet connection


with Raspberry Pi through LAN/Ethernet
(HeadlessMode)

Shairul
December 18, 2015 at 3:40 PM

Assalamualaikum, Mr. Anwar.


I tried every step of the procedure. Alhamdulillah, i got it earlier. Once I
upgraded the Raspbian Wheezy to Jessie, everything gone head-wire. I
reformat back the SD to Wheezy, and subsequently, the internet
connectivity unable to achieve. Same as other, Im using Window 7 HP and
be advised, my rpi able to Putty and Xming earlier. Very dire of your
assistance thus Im using rpi 2 for my final year project. And now, the
projects progress from 40% achievement down to 0%. Cant figure out
which step I missed. Duly waiting for your assistance.

Anwaarullah
January 5, 2016 at 4:58 AM

Wa Alaikum As Salaam, are you still facing the same issue?

Nizar Boussarsar
January 15, 2016 at 6:51 PM

Assalamou Alaykom Mr. Anwar,


https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

14/15

1/20/2016

SharingWiFiInternetconnectionwithRaspberryPithroughLAN/Ethernet(HeadlessMode)SyedAnwaarullah

First, I would like to thank you for this tutorial. It is great.


I am running Windows 10 on my PC and Debian Jessie on my Raspberry Pi. I
followed all the steps but I wasnt able to ping outside from my LAN. In
fact, when I ping the RPi from the PC it goes well but the other way does not
pass. I unchecked the Ethernet connexion from the Protected network
connexions window and I was able to ping the PC from the RPi but not the
Internet. So I probably think that the problem is coming from the Windows
10 Firewall.
I would be grateful if you can help me fixing this issue. Thank you.
Sincerely,
Nizar

Anwaarullah
January 16, 2016 at 12:32 AM

Wa Alaikum As Salaam Akhi,


Im Sorry, I dont have access to a Win 10 machine and hence I cant
debug it

The Twenty Sixteen Theme. Syed Anwaarullah / Create a free website or blog at
WordPress.com.

https://anwaarullah.wordpress.com/2013/08/12/sharingwifiinternetconnectionwithraspberrypithroughlanethernetheadlessmode/

15/15

Das könnte Ihnen auch gefallen