Page 1 of 1

No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 12:48 pm
by Zvanochek
Hi,

Sure this has been covered many times but the few previous posts on here I went through didn't help.

I'm using the Pi to use my Pi headless, accessing it through SSH on my Win7 desktop. I connected the Pi to my router and all was fine and dandy, expect the router is downstairs. I went through a couple of tutorials and explanations on how to set up my pi to connect to my PC through an ethernet cable. I have got to the point where I can access my Pi with SSH with it directly connected to the PC. Great! But I don't have internet access on the pi, which although not vital, would be useful for updates and downloading packages etc. Can someone point out where i've gone wrong with my set-up?

If useful, here is my ifconfig and interfaces files:

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:13:16:17
          inet addr:192.168.250.2  Bcast:192.168.250.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:95 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13245 (12.9 KiB)  TX bytes:12980 (12.6 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.250.2
netmask 255.255.255.0

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
The guides I've been using are:
http://www.raspberrypi.org/phpBB3/viewt ... ne#p326039
http://www.raspberrypi.org/phpBB3/viewt ... ne#p305085
http://glynrob.com/hardware/raspberry-pi-headless/
http://www.raspberrypi.org/phpBB3/viewt ... ne#p271196
and a few others.

Thanks in advance!

Andrew

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 12:52 pm
by JeremyF
Zvanochek wrote:

Code: Select all


iface eth0 inet static
address 192.168.250.2
netmask 255.255.255.0

You are missing a gateway. I assume the traffic goes through your router first -- not a direct connection

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 12:58 pm
by pluggy
If you've set the Windoze box up to share its internet connection, the easiest way is to use the Pi's default network settings (DHCP), although you'll need to do some digging to get its IP address.

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 1:00 pm
by remsnet
Update network config ..

Code: Select all

vi /etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.250.2
netmask 255.255.255.0
        broadcast 192.168.250.255
        gateway 192.168.250.1
        dns-search your.net.name
        dns-nameservers 192.168.250.1


allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 1:41 pm
by Zvanochek
Okay, stupid question:
remsnet wrote: dns-search your.net.name
dns-nameservers 192.168.250.1
Do you mean to literally put that into the interfaces file? If I do that, then I loose the SSH connectivity to the Pi.

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 1:56 pm
by rpdom
remsnet wrote:Update network config ..

Code: Select all

iface eth0 inet static
address 192.168.250.2
netmask 255.255.255.0
        broadcast 192.168.43.255
        gateway 192.168.250.1
        dns-search your.net.name
        dns-nameservers 192.168.250.1
That broadcast address looks completely wrong for that subnet.

Actually, the broadcast line is redundant, as it gets worked out from the address and netmask lines, along with the network parameter which I've noticed people still using on occasions.

Re: No internet connection through ethernet connection

Posted: Fri Apr 19, 2013 7:24 pm
by Zvanochek
So should I just leave that part out then?