sixstringsg
Posts: 7
Joined: Sat Jul 07, 2012 6:17 pm

IP Address lost

Mon Mar 11, 2013 12:14 am

A Little background: I have two Raspberry Pi's, one that is the older model B and one is the newer one with 512mb RAM. I have one set up as a file server, and one runs XBMC. Periodically, they lose their ability to connect to anything over ethernet. They are both plugged into the same switch, then the switch into the internet. When this happens, I try and restart them, restart the switch, nothing works. If I re-install the OS, that usually fixes it. Is there something that I am doing wrong that is messing with the ethernet port? This has happened on raspibian and two different distro's of xbmc.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: IP Address lost

Mon Mar 11, 2013 8:44 am

sixstringsg,
Are you connecting wirelessly (WiFi) or wired? Are you using static IP addresses or DHCP. By default raspbian uses DHCP to get the IP address (don't know about XBMC). If DHCP is in use, I guess your "switch" is really a "router" and, if that's the case, it is/should be running the DHCP server and hence, when connection is lost, that should be re-started first, wait 30 secs or so (for the server to re-start), then re-boot the Pi's. Our household has a mixture of WiFi (routers) and wired switches. The main WiFi router, which feeds the "internet cable box" occasionally "throws off" a connection (mostly the wireless printer) and I have to restart that (the printer) or both to re-establish connection.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

sixstringsg
Posts: 7
Joined: Sat Jul 07, 2012 6:17 pm

Re: IP Address lost

Mon Mar 11, 2013 7:27 pm

I am using DHCP for both of them. I am quite sure that my switch is just a switch and not a router. I am however on a university campus, so my switch connects to a router that has a DHCP server. Since that is the case I can't really restart the router, only the Pi's. And the entire thing is connected wired, not wireless.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: IP Address lost

Mon Mar 11, 2013 8:35 pm

Hmmm. Not quite the setup I was thinking of. The only thing that comes to mind is possible "lease time" issues - A DHCP server usually "leases" an IP address to the client for a fixed time, usually a few hours. This is because the local (sub-)network will only have a limited number of such available. Maybe, since, presumably, the "campus router" serves a number of "rooms/buildings", there are times when a Pi tries to renew its lease but there isn't a spare IP address available. However, that is "just a possibility". From your original post I thought you were using the Pi's as file/music? servers to a much more "localised" network via the switch. The other puzzle is that you have to "re-install the OS to fix it". This suggests that something odd is happening to the network configuration files invoked during start up. All I can suggest for now is perhaps, and assuming you can still use the Pi un-networked, when the "network connection" fails, next time, before re-installing the O.S. (esp. raspbian) you edit the network startup files to use a static IP address (info. on how to this is in the wiki IIRC) and see if you can now connect to another computer (which, if using the switch, but NOT the router, may also need a different static IP addr. eg Pi 192.168.1.1 , other computer 192.168.1.2) via your cabling. Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Networking and servers”