Sharing WiFi Internet connection with Raspberry Pi through LAN/Ethernet (Headless Mode)

Update 25th August, 2017: I haven’t tried this method yet on the recently released Raspbian Stretch version. However, one user has confirmed that the first method works on it. If it works for you, please let us know through the comments. Thanks.

Update 29th Dec, 2016: If you’re using the latest PIXEL Image, please make sure you enable the SSH Server by placing a a file named as ssh in the boot directory before trying any of the following methods. The SSH Server on boot has been disabled in the latest Raspbian image as a security measure. Read more about it here:

Update 9th July, 2016: I’m inspired by this method of SSHing into a Pi through the USB only and gonna tinker and see if we can get to also share Internet over to the Pi using only the USB. (No more messy LAN Cable 🙂 ). If you get it working, please share.

Update 10th July, 2016: I’m afraid, I won’t be able to get the above method running on a Pi 2/3 as it’s only supposed to work on a Pi Zero. If you have a Pi Zero and are interested in Sharing WiFi over USB, please check out

Updated 5th April, 2016 with Striner’s method


If this Tutorial helps you, please consider PayPaling me any positive integer at

This post will allow you to share WiFi Internet connection of the PC/Laptop with the Raspberry Pi which are connected to each other through a simple LAN/Ethernet cable connection at each end.

What you want to do:

  1. Share PC/Laptop’s WiFi Internet connection with Raspberry Pi through LAN/Ethernet connected to Raspberry Pi

What you have:

  1. Raspberry Pi B/B+/Pi 2/Pi 3 (If you’ve a Pi Zero, please try and let us know if this works on a Zero. I haven’t got a Pi Zero yet) running the latest Raspbian Wheezy. (I’ve not yet tried it with recently released Raspbian Jessie based off Debian 8. If you’ve been successful with this latest release, please post in the comment and I’ll 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) Not required if using Striner’s or Bridge.

What you don’t 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

The easiest way to go around Sharing WiFi with Raspberry Pi is to follow Striner’s method of Sharing WiFi with the Raspberry Pi.

I’ve tested it with Raspberry Pi 3 and Windows 10 and he’s tested it on Win 8.1 and an earlier Pi and should work will Raspberry Pi B/B+/Pi 2/Pi 3. This hasn’t been tested with Win 7, though it mostly should work. Please give a shoutout and let us know if you’ve tried on Win 7 and it works.

Method 1: Striner’s Method

Tested On: Windows 10 & Raspberry Pi 3 & Pi B (the Yellowish RCA model 😉 )
Known to work on: Windows 8/8.1 & Raspberry Pi B/B+/Pi 2
Not tested (yet) on: Windows 7 & Raspberry Pi B/B+/Pi 2/Pi 3

1.1 Open up the Network and Sharing Center settings and navigate to Change Adapter Setting

Raspberry_Pi_WiFi_Sharing1.2 Right click on the Wireless Adapter and hit Properties

Raspberry_Pi_WiFi_Sharing1.3 Navigate to the Sharing Tab and select the Allow other network users to connect through this computer’s Internet connection checkbox

Raspberry_Pi_WiFi_Sharing1.4 Now right click the Lan Adapter and hit Properties. Double click the IPV4 option and verify that some dynamic IP is populated ( in my example)




1.5 Now Power ON the Raspberry Pi (ignore if already powered ON :P) and connect one end of the LAN Cable to the Raspberry Pi and the other end to the PC. You should be able to see status messages Identifying… and eventually Unidentified network


1.6 Open up cmd prompt and type in:


You should be able to ping the Raspberry Pi:


1.7 Open up Putty and set the Host Name as: and hit connect. (You can also use the IP address of the Pi revealed in the above ping prompt:


1.8 You should be able to see the login prompt. Hit pi and raspberry and Enter


1.9 You can now


(or any other website) from within the Shell and you’ll have response messages. Congratulations! Your Pi now is connected to the World Wiiiiiiide Web 😉


Testing apt-get


Big Thanks to Danny Striner, who shared this method in a comment and tested it out. Full credit goes out to Striner. I’ve named this method as the “Striner’s Method” to honor him 🙂

P.S: If you run into issues trying out this method, please disable windows firewall and try again (as pointed out by some users in the comments).

Method 2: Using Network Bridging

Edit: [12:58AM IST, 1 Feb, 2016]: I just stumbled upon a super simple process of Bridging the connections and directly ping and access Internet on the Raspberry Pi without having to edit anything on the SD Card’s cmdline.txt file.

Tested On: Windows 7 & Raspberry Pi 2
Known to work on: Windows 7/8/8.1 & Raspberry Pi B/B+/Pi 2/Pi 3
Not tested (yet) on: Windows 10 & Raspberry Pi B/B+/Pi 2/Pi 3

This process worked flawlessly for me and I’ve wrote a detailed tutorial here:

If this doesn’t work, please follow Method 3 below.

Method 3: Editing cmdline.txt file of Raspberry Pi SD Card

Tested On: Windows 7 & Raspberry Pi B/B+/Pi 2/Pi 3
Known to work on: Windows 8/8.1 & Raspberry Pi B/B+/Pi 2/Pi 3
Not tested (yet) on: Windows 10 & Raspberry Pi B/B+/Pi 2/Pi 3

Edit: 2nd Jan, 2015. Added Video Tutorial:

A large part of this post assumes you’ve read the earlier post on directly accessing the shell on Raspberry Pi through a Ethernet/LAN connection. In this post, we’ll go about setting up the Raspberry Pi to access internet through the RasPi’s Ethernet/LAN port from a Laptop/PC’s shared WiFi connection.

Method 3 Steps:

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


Note: I’m using my Android device (Nexus One) configured as a WiFi hotspot J

  1. Now, go to Network and Sharing Center (Network Settings in Win XP) and then head to the Change Adapter Settings page. As shown below, we’re connected to ‘Wireless Network Connection’ on ‘Android 4’. Do remember the ‘Local Area Connection’ to which we’ll eventually share this connection


  1. Now, right click the above Network → Properties and then select the Sharing tab


  1. 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



  1. Now, right click ‘Local Area Connection’ → Properties and then select Internet Protocol Version 4 and then click the Properties Button


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


  1. 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.
  2. 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)
  3. In the command prompt, key in ipconfig and scroll to the top of the info shown


Note the IPv4 address which is in this example. Please make a note of what you see as this will be required further.

  1. Now, power off the Raspberry Pi and plug the Ras-Pi’s 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



You’d probably have an entry as ip= which we set up in our previous post

  1. 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 ( and the other half is the IP of the IPV4 or Ethernet Adapter ( which we obtained earlier.

  1. 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.
  2. Now, to verify if our Ras-Pi is Internet-Connected, type in this command in the Shell (PuTTY terminal connected to the Ras-Pi)


and you should see response from the servers as shown below:


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

  1. Going one step further, lets direct access the Raspberry Pi’s desktop and 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 pre-installed with the latest Raspbian version and has been replaced with Epiphany Browser. Please use that instead to verify internet connectivity.

Method 4:

Check out the comments. Many users have shared their own techniques which work on Win 8/10 flawlessly.

Please let me know your feedback or questions through comments.

Thanks 🙂



P.S: Did this post help you? Please leave your feedback. If you’ve tried some additional steps that helped you in getting this working, please share so we all can benefit from.

If you’ve benefited from this post, please consider donating and help me buy new development stuff and create new tutorials/resources. Thanks!



Author: Anwaarullah

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

214 thoughts on “Sharing WiFi Internet connection with Raspberry Pi through LAN/Ethernet (Headless Mode)”

  1. 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, I’m using Window 7 HP and be advised, my rpi able to Putty and Xming earlier. Very dire of your assistance thus I’m using rpi 2 for my final year project. And now, the project’s progress from 40% achievement down to 0%. Cant figure out which step I missed. Duly waiting for your assistance.

  2. Assalamou Alaykom Mr. Anwar,

    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 wasn’t 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.


      1. your first method works great on windows 10 with raspberry pi 3 b running raspbian strech i was looking for an easy tutorial and first one that worked was this one thanks alot

  3. i use raspberry pi 2 B+,i connect putty and work well,but after use wifi share option,i connect putty but it will appear connection time out..please help me get out of this.

  4. First of all, thank you! After attempting to use multiple guides your’s got things working for me. All the others failed to note you must include the static IP AND the Default gateway for the LAN cable in the cmdline.txt.

    Thank you so much for this detailed guide!

  5. Thank you so much Mr. Anwar for this tutorial….I have been trying to connect my rasp-pi to internet for 10-15 days using different guides and forums but it didn’t work out….your easy to follow tutorial made that happen….Thank you once again:)

  6. Hey Anwaar,

    I could replicate almost everything, except that if I share my WiFi internet connection, I couldn’t event connect to Pi via putty.

    I checked I have obtain IP automatically for both laptop and Pi.

    Could you help me please?

  7. I have did as u suggested sir but internet connection is not need…. p.s very urgent review is next week

      1. Thanks for the reply.
        It got fixed “sudo nano /etc/resolv.conf”
        nameserver was assigned as my static given ip address so i changed to It works fine now.
        Thank you.

      2. 1.sudo nano /etc/resolv.conf(It will open a editor window)
        2.Changed “nameserver:*******” to “namesrver:”
        That’s all I did.It worked for me.

  8. i tried method-1 & method-2. I got stuck @ last step as Manojkl. But in my case /etc/resov.conf is already having nameserver Please help me out

  9. Anwaarullah…Thank you for the Tutorial.Very helpful.easy to understand.
    i tried all the methods(1,2,3). All steps are fine. But I m not getting internet in pi. Any suggestions? I m using Raspberry Pi 2 Model B 1GB. Please help me.

    1. Which method is not allowing you to share Internet? Please note that all the 3 methods are different, and have to be debugged individually. If moving over from Method 1 to Method 2 (and to Method 3), please undo any changes/modifications made in the previous method.

      1. Dear Anwaarullah, I tried all the methods (1,2,3) separately with the same initial settings. Does firewall can block internet on Raspberry? Because I could ping Raspberry as well as Internet from my computer. I could ping my computer from Raspberry-pi.But Internet is not passed to Raspberry-pi. Please help me out.

  10. Hello, I have a question. I’m trying to connect to internet using METHOD 1.
    Everything works great till step 1.8, but still I’m unable to ping any website(not able to connect to internet).
    I’ve double checked sharing settings for my WIFI, seems good.
    How do I troubleshoot it? Please help !!
    1. RPi 2 Model B running Debian
    2. Dell Inspiron running Windows 10

  11. Method 1: Striner’s Method works on Windows 10. I set it up using wifi through a Microsoft Surface 4 with a Simplecom USB 3.0 to RJ45 Gigabit Ethernet Network Adapter connecting to my Raspberry Pi 3.

    Thanks for the help. Very quick set up.

    On a side note. The Method 2: Using Network Bridging didn’t work on my Surface 4. I’ve used this method through my PC and found it to be the quickest, easiest set up, but the Surface and Ethernet adaptor didn’t seem to like it so I tried Method 1 and that worked.

  12. Hello. I am trying out the first method. However when I try the command ping I get 4 times of “Request timed out”. How do I solve this? Please help…

  13. Hi thank you for sharing Method 2, I can use internet now some of the time on the Raspberry Pi 2B, and Method 2 is working ok on Windows 10 !

    My only problem now I think is :

    I was changing the network settings (i.e. changing /etc/network/interfaces) a lot before in Raspberry Pi trying to get it to work, and now internet is not reliable – it’s on for 5 minutes , then randomly off until I reset.. – so i’m going to install Raspbian again fresh on the SD card.. then use the Method 2 after (thanks again for this guide )

  14. Lovely post and it actually made my day..
    I have been able to connect the Pi2 on windows 7 and also see the gui using xming and putty.

    However, are there any posts of yours for windows 10. It would be a real big help.. end up carrying two laptops everywhere until then.. LOL

    Thanks again for the lovely post !! 🙂

  15. Assalamualaikum Anwar, i’m trying to follow the 3rd method, but fail at the 12th step.
    When i try to ping, it shows “ping: unknown host” as the result.
    It can ping itself (ping, but can not ping the ethernet interface (ping
    Can you give me some suggestions?
    Please help.

    Thank you very much.

  16. I try to ping but it say unreachable. How do i do?


    Pinging [] with 32 bytes of data:
    Reply from Destination host unreachable.
    Request timed out.
    Request timed out.
    Request timed out.

    Ping statistics for
    Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

    1. Using a latest Raspbian Image? SSH on Pi enabled? Latest image has the SSH turned OFF by default. Please have it enabled first by placing a dummy file in the SD Card (details found in first section of this post).

    2. I know it must be irrelevant at this point but i was having the same issue and it was caused by some Windows 10 problem with ICS. To get it to work just (assuming you have enabled internet sharing, the RPi is on and connected via Ethernet, and the wole thing its not working) -> disable sharing internet -> click OK -> enable again -> click OK -> disconnect the ethernet cable -> reconnect it -> wait and maybe it will work (just like it finally worked for me)
      I tried others methods like appending ip=19….. at the end of cmdline.txt in the SD but nothing else worked thanks to the faulty ics on Win 10.
      I hope this helps somebody

      Raspbian Stretch with desktop
      Version: November 2017
      Release date: 2017-11-29
      Kernel version: 4.9

      Windows 10
      build 1709

      Laptop HP without BIOS LAN/WLAN switching option (sometimes the problem is caused when you have this setting and its enabled in the BIOS)

      1. OK I have no idea why this works but it just does. I have been struggling with Windows Networking in general but this just happens to puzzle me the most. It seems reconnecting the cable may help the ICS rediscover the device, and assigning it a new local address that works.

        Kudos to you, it is never irrelevant to point out this kind of strange issue. Helped a lot.

        My devices:
        Raspberry Pi 2 B+ Model, running Raspbian Jessie
        Windows 10 Home

  17. Hey there,
    first of all, thanks for sharing!

    I was trying to bridge the connection and also sharing wifi to eth0 but non of them worked for me. When sharing my macs wifi to the pi it works flawless…not sure why though. Can you please provide your /etc/network/interfaces? Might help me 🙂

  18. Method 1 did not work for me, dont know why.
    But method 2 worked without problems.
    I have a raspi B+ with jessie noobs installed and a ethernet cable to windows 10.

    1. .. and I had a my pi named blackberry so I could do putty SSH to blackberry.local without scanning for the IP address.

  19. hello sir!
    i am using Method 1 , everything works fine but when i use ping , it shows- destination host unknown,packets are being transmitted but not recieving, please help me its urgent,i cant try other method right now+ i have turned my firewall off…..

  20. hi i’m using raspberry pi 3b with win 10. i tried all the methods. Connecting to SSH is fine but i couldn’t connect the pi online. when i ping the error showed “connect: Network unreachable” Help me pls!!

  21. Hello, I have a problem with my Raspberry Pi. My OS is windows 10. I used the raspberry pi at the first time and it worked well using ethernet cable until i followed some instruction about Alexa and i terminated the process. After that, when i used google chrome, it stopped. Then my laptop asked to update somehow. After i updated, i cannot ping, it said request timed out, so i of course i cannot use putty anymore. But when i connect pi to my friend’s laptop using the same ethernet cable, it worked well. Do you know what is the problem and how to solve it? thanks

  22. Assalamu’alaikum Sir, I have a problem about the step no 1 and 2. I haven’t got the reply after “ping” on cmd. So, I can’t continous the process. What could I do, Sir?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.