1

I'm sort of a newbie in using DHCP and I hope someone can help me with my problem.

I wanted to share the Internet access of my laptop (OS: Windows 10) to my Pi using an Ethernet cable. I tried following the instructions from this thread:

I already configured the ICS of my laptop and also tried the same procedure with other laptops, but I still can't seem to get my RPi to have Internet access.

After hours of research, I still can't seem to get my Pi to access the Internet. When I check the IP address of my Pi's Ethernet, I get 169.254.x.x. Based from what I've read from some forums, the 169.254.x.x IP means that my Pi isn't getting any response from the DHCP server.

I also tried to set a static address for my RPi's eth0 interface, but nothing changed, but I think there were errors in my procedure.

My questions are:

  1. Is my laptop the DHCP server?
  2. How can I fix the 169.254.x.x problem?
  3. If ever I won't settle for the DHCP server and I wanted to set a static IP address for both RPi and laptop, what's the correct syntax/method/procedure?

Any suggestions, solutions, or explanations on how to fix this is a big help. Thanks!

P.S. - Directly connecting my Pi to a router via Ethernet works. But what I really want is direct connection between laptop and Pi so that I can share my laptop's Internet access to my Pi.

  • A [Link-local address](https://en.wikipedia.org/wiki/Link-local_address) indicates your Pi has not been allocated an address by the DHCP server. This is something that has to be done in the ICS machine; **NOTHING** you can do on the Pi is going to "fix" this. How to configure Windows 10 is NOT a Pi question. – Milliways Nov 03 '17 at 05:17

2 Answers2

2

First things first you're getting what's called APIPA or Automatic Private IP Addressing which means your Pi isn't getting access to DHCP. There are two possible issues. The first is that your ethernet port is not auto-sense and doesn't know how to communicate with the type of ethernet cable you're using. You'll need a crossover cable in that case.

EDIT(12/06/2018_2:46PM): As user goldilocks stated in a comment the Raspberry Pi has Auto MDI-X and so cable compatibility is unlikely to be the problem.

The other thing is with Internet Connection Sharing(ICS) you're not always going to have DHCP enabled, though Windows 10 is capable of providing DHCP with ICS. You may want to enable access to your networks DHCP through the shared connection (See images below. Note: My ICS setup shares the internet connection of my ethernet through my WiFi adapter.) or set the connection's IP addresses statically along with a compatible subnet and gateway.

The static IP option will require knowing the IP address assigned to the connection (Ethernet port vs. Wi-Fi adapter) of the device that you are connecting the Raspberry Pi to. This can be found using the command prompt. Press the Windows Logo key + R and type cmd into the run dialog box. Next in the command prompt you can copy and paste or type:

ipconfig /all | findstr /r "adapter Description IPv4 Subnet Gateway DNS.Servers [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"

This will list your adapters and their IPv4 settings. (Note: If you use IPv6 exclusively you can change IPv4 to IPv6 or add IPv6 ^*:.* .*::.* inside the quotes of the above command if you want to include both. The output may still output IPv6 addresses if you're using IPv6 with IPv4.) Once you have the IP address of the adapter you'll be connecting your Raspberry Pi to you'll want to use those numbers to set the Static IP (tutorial here) of your Raspberry Pi.

ICS Sharing Settings ICS Advanced Settings

Das_Newb
  • 71
  • 7
  • 2
    You could not possibly need a crossover cable: All Pi jacks have [auto MDI-X](https://en.wikipedia.org/wiki/Medium-dependent_interface#Auto_MDI-X), and only *one* party needs to have it. – goldilocks Dec 06 '18 at 20:10
0

Try this.... Watch the video first(Given in the link) Click here to know how to setup static ip for RasPi And set static ip for your PC's Ethernet adapter and Check that your WiFi adapter shares internet. Static IP for ethernet WiFi internet sharing

Ganesh
  • 31
  • 7