Zvanochek
Posts: 12
Joined: Thu Jan 05, 2012 1:56 pm

No internet connection through ethernet connection

Fri Apr 19, 2013 12:48 pm

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

JeremyF
Posts: 515
Joined: Wed Jan 25, 2012 9:06 pm
Contact: Website

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 12:52 pm

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
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 12:58 pm

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.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

remsnet
Posts: 151
Joined: Wed Dec 19, 2012 7:32 pm
Location: Planet Gaia
Contact: Website Yahoo Messenger

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 1:00 pm

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
Last edited by remsnet on Fri Apr 19, 2013 2:24 pm, edited 1 time in total.

Zvanochek
Posts: 12
Joined: Thu Jan 05, 2012 1:56 pm

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 1:41 pm

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.

User avatar
rpdom
Posts: 12815
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 1:56 pm

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.

Zvanochek
Posts: 12
Joined: Thu Jan 05, 2012 1:56 pm

Re: No internet connection through ethernet connection

Fri Apr 19, 2013 7:24 pm

So should I just leave that part out then?

Return to “Troubleshooting”

Who is online

Users browsing this forum: achrn, Roger_Thornton, vvarrior and 60 guests