I am going to be staying in a hotel in the future, and I need to be able to use Ethernet devices there. The hotel provides free WiFi, however it has no way of providing Ethernet.

I have the idea of connecting to the free WiFi using a Raspberry Pi, and then pushing the internet connection out of the Ethernet port on the Pi.

This website seems to explain what I need to do, as does this post.

Everything seems fine here, apart from the bind addresses for the WiFi adapter. I don't know what IP addresses will be available on the WiFi network, and although I could put in a random ip address like 192.168.0.239, I don't know what range the network runs on either. It could be X.X.X.X, for example:

  • 192.168.0.X
  • 192.168.42.X
  • 10.0.2.X
  • 10.0.0.X

How can I make this set-up work without knowing any of the DHCP information beforehand?

Thank you for any responses.

  • 1
    I have this exact setup in my dorm room. You don't need to worry about DHCP. Follow this link. – pandalion98 Mar 22 '17 at 8:29
  • @pandalion98 This still seems to require the exact IP address of the router with the internet connection, which I cannot get. – DevelopedLogic Mar 25 '17 at 8:39
  • You can get the IP address of a router fairly easily. In Windows, you can use CMD and type in 'ipconfig'. I'm positive there's ways to do this on pretty much every platform, just don't know which one(s) you have access to. – C Malasadas Apr 1 '17 at 2:52
  • @CMalasadas I guess this would work, yes. I have access to the Pi, and a windows laptop. – DevelopedLogic Apr 1 '17 at 4:56
  • You could probably do it on the RPi, I'll do some research and post an answer soon. – C Malasadas Apr 1 '17 at 11:52

To find your IP address on RPi, do the following:

In the command line, type:

ping google.com

Then press CTRL-C to stop. This is making sure you have a successful connection.

Now, type:

ip addr

And you should see something like this:

pi@raspberrypi ~ $ ip addr
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  link/ether b8:27:eb:8e:b7:42 brd ff:ff:ff:ff:ff:ff
  inet 192.168.1.17/24 brd 192.168.1.255 scope global eth0  
pi@raspberrypi ~ $

Your IP address is directly after the second inet (which is below link/ether). In this case, your IP would be 192.168.1.17.

Although it can be done with a Raspberry Pi I'd like to offer the D-Link N300 as an alternative solution. It is a range extender with in-built ethernet. I have this device and it works well for the low cost.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.