Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
07-17-2014, 12:38 PM
|
#1
|
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Rep:
|
Raspberry Pi wifi flaky
I'm having wifi issues with my new Raspberry Pi model B running Raspbian Wheezy with an edimax wifi usb adapter...but only away from my house. The wifi works fine in my house. When not in my house I can still connect with ssh but a simple ping gives of www.google.com gives this:
ping: unknown host www.google.com
I have static routing setup in /etc/network/interfaces:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.20
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
wpa-ssid "network"
wpa-psk "password"
***************************
This is really strange-does anybody have any idea how I could use an internet enabled wifi device outside my house?
|
|
|
07-17-2014, 02:00 PM
|
#2
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
|
You should use DHCP on other networks. It's also possible that even at home you have DHCP addressing from your router, but you can configure manually for an address and get away with using the network so long as you're authenticated by the router and you've matched the addressing scheme for your network. Simply put though, don't assume everyone uses 192.168.1.x networks in their public WIFI; most of the public networks will want you to DHCP for your address.
|
|
|
07-17-2014, 02:12 PM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,256
|
At first glance I thought the same thing but you can also infer from the information given that the OP is connecting via ssh to the Pi from a computer outside the home network and then trying to ping google. This would not be a Pi wireless problem.
So the OP needs to clarify a bit as to what they are trying to accomplish.
|
|
|
07-17-2014, 02:34 PM
|
#4
|
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Original Poster
Rep:
|
what's OP? I'm running my Raspberry Pi headless with ssh enabled, so if I use DHCP then how would I find the IP address being used? I connect to it using ssh on an android app. I tried all kinds of other android apps that would tell me what port it's using with nothing. Maybe it just isn't getting an IP address with DHCP. How should I change my /etc/network/interfaces file to use DHCP?
|
|
|
07-17-2014, 02:38 PM
|
#5
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Quote:
Originally Posted by linuxhippy
what's OP?
|
Forum Shorthand for "Original Poster",.. in this case referring to you, LinuxHippy.
|
|
|
07-17-2014, 02:42 PM
|
#6
|
Moderator
Registered: Aug 2002
Posts: 26,256
|
What's OP? you i.e. Original Poster or Original Post depending on context.
So you can ssh from your Android device to the Pi successfully? And what is the ultimate goal?
|
|
|
07-17-2014, 03:01 PM
|
#7
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
|
The following will make it so that your WIFI interface performs DHCP.
Change your iface wlan0 line to match your eth0 line:
Code:
iface wlan0 inet dhcp
And comment out all of: address, netmask, network, broadcast, and gateway using # before all of them.
Last edited by rtmistler; 07-17-2014 at 03:02 PM.
|
|
|
07-17-2014, 03:08 PM
|
#8
|
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Original Poster
Rep:
|
ok, that'll give me dhcp...then how do I find the IP address since I won't have it connected to a monitor and keyboard? Maybe running some Android app that can sniff out what addresses the router has given? The firmware on the router I'm using outside my house stinks and unlike ddwrt doesn't tell u which devices have which address.
|
|
|
07-17-2014, 03:13 PM
|
#9
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
|
Quote:
Originally Posted by linuxhippy
ok, that'll give me dhcp...then how do I find the IP address since I won't have it connected to a monitor and keyboard? Maybe running some Android app that can sniff out what addresses the router has given? The firmware on the router I'm using outside my house stinks and unlike ddwrt doesn't tell u which devices have which address.
|
You said you were ssh'ing to it. ... OK I get you there. Well I was gonna say SSH to it (D'uh!!) and then run 'ifconfig'.
Raspberry Pi. ... See Beaglebone supports a network over USB therefore the primary Ethernet or WIFI may be something else, and the USB network is always there and always a certain address; therefore I can reach the BBB that way.
But wait a minute. Pi has a wired Ethernet port. Set that up for a static IP, a'la the way you had the WIFI set up and then hook a cable between a laptop and the Pi with the laptop set for the address, and then you should be able to find the address. But you say you have a tablet, not a laptop. Interesting issue, well you can hook up a monitor, keyboard, and mouse to that Pi...
|
|
|
07-17-2014, 03:18 PM
|
#10
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
On my home network I could use the ping network scanner (ping sweep, basically) "app" on my iPad to find my Pi as the "app" does detect it as a Pi. I'm sure there's something similar avaliable for Android.
If you have access to the router then I suggest you tell it to set a reserved DHCP address for your Pi so that when it connects it always gets the same IP address.
|
|
|
07-17-2014, 03:20 PM
|
#11
|
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Original Poster
Rep:
|
I'd have to get a portable usb keyboard, but I could hook a cable into my Android TV which runs Linaro and has a usb ethernet adapter...what kind of cable would I need to ssh between the two? Just a cat5 ethernet cable?
|
|
|
07-17-2014, 03:24 PM
|
#12
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
|
Quote:
Originally Posted by linuxhippy
I'd have to get a portable usb keyboard, but I could hook a cable into my Android TV which runs Linaro and has a usb ethernet adapter...what kind of cable would I need to ssh between the two? Just a cat5 ethernet cable?
|
Yes normal CAT5 Ethernet cable will work fine.
|
|
|
07-17-2014, 03:33 PM
|
#13
|
Moderator
Registered: Aug 2002
Posts: 26,256
|
I think I understand the problem.
If you configure a static IP on the Pi but do not add any namesevers in /etc/resolv.conf you will not be able ping via URL i.e google.com. Now you could configure the Pi with DHCP and a with router DHCP reservation it will technically be static and resolv.conf will be automatically configured.
|
|
|
07-17-2014, 03:37 PM
|
#14
|
Senior Member
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Original Poster
Rep:
|
I'll try that tomorrow (I have to get the cable from my house). This isn't a public wifi spot that I'm accessing but my second router that I have...it's a Clear spot. I can use a web browser to get into the router, though there aren't many things that can change. I haven't looked in this one for a while but I don't remember it having a place to adjust your dhcp lease time. Once your dhcp lease expires, would a router just give a different address or does it keep giving out the same one? How long is a typical lease...30 days?
|
|
|
07-17-2014, 03:39 PM
|
#15
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
|
Quote:
Originally Posted by linuxhippy
I'll try that tomorrow (I have to get the cable from my house). This isn't a public wifi spot that I'm accessing but my second router that I have...it's a Clear spot. I can use a web browser to get into the router, though there aren't many things that can change. I haven't looked in this one for a while but I don't remember it having a place to adjust your dhcp lease time. Once your dhcp lease expires, would a router just give a different address or does it keep giving out the same one? How long is a typical lease...30 days?
|
If it's your router and you can get to the web management portal, then you should be able to see the IP address it assigned to your Pi as part of the statistics for connected clients.
A typical lease time is (I thought) 24 hours. I believe also that if it expires, the two entities, being your computer and the router will renegotiate or renew the lease; in fact you'll find that if you attach daily, likely you'll obtain the same IP address each time you attach, especially in an environment that doesn't change much like your personal network. I see that at home with given laptops, they always get the same address. You just can't "depend" on that as an absolute.
Last edited by rtmistler; 07-17-2014 at 03:42 PM.
|
|
|
All times are GMT -5. The time now is 07:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|