gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

no network on reboot

Mon Sep 02, 2013 9:31 pm

Hi everyone!
This question may not be strictly arch-related...
Very often on reboot my headless raspi is not accessible via SSH even if it is booting fine (according to the status led). I usually need to unplug and plug the power several times before the network starts working. This obviously means that I cannot reboot remotely...

An acceptable solution would be to make the watchdog work on network connectivity, but when I configure for that, I just end up in an infinite reboot loop (I think it's a known bug).

Any idea?
Thank you

sdjf
Posts: 1394
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: no network on reboot

Tue Sep 03, 2013 6:16 pm

What arch image are you running? When did you last update your system?

Do you have netctl working? My hunch is you are running an older version, because I experienced the kinds of problems you describe until I upgraded and wrote a proper netctl profile for my needs.

And what is your hardware setup? Do you expect to be sshing in over plain ethernet, with or without a router, etc.?
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: no network on reboot

Tue Sep 03, 2013 8:09 pm

Jus some general notes-
Always sync before reboot or poweroff
Same IP address is not guaranteed with dhcpcd

drirr
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am

Re: no network on reboot

Wed Sep 04, 2013 3:16 pm

As pepedog mentioned, if you're using dhcp you might getting a new IP-address at each boot. If that's the case and you have your rpi behind a router you should check if you can specify a static lease for it so you always get the same ip-address.

If it's exposed directly to the internet and your ISP gives you different ip-addresses I'd say you need something like dyndns or no-ip.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: no network on reboot

Wed Sep 04, 2013 7:00 pm

Check you have a serial number set, if its all 0's you get a different MAC address every boot
uname -a

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: no network on reboot

Sun Sep 08, 2013 8:01 pm

Sorry, clearly this question needed more details...

- I recently installed a clean archlinux-hf-2013-07-22.img, but the same problem was there with the previous install, and the system is regularly updated
- I don't have netctl configured, actually I haven't configure anything regarding the network.
- my raspi is behind a router, and I SSH to it either over WiFi if I'm at home or by the dyndns address if I'm outside. The local IP is assigned by my home router by dhcp
- didn't know about sync before reboot, I maybe have to read more about it, but it doesn't seem to be needed nowadays
- I'm not sure about the Mac number question, but this is what uname -a gives me:
Linux alarmpi 3.6.11-14-ARCH+ #1 PREEMPT Sun Jul 21 17:39:58 CDT 2013 armv6l GNU/Linux


Hope this clarifies,
Thanks

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: no network on reboot

Sun Sep 08, 2013 8:03 pm

And if you meant the raspberry serial number, that I get with cat /proc/cpuinfo, it's not made of all zeros

drirr
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am

Re: no network on reboot

Mon Sep 09, 2013 3:50 pm

Have you done any configuration in your router or did you just plug the rpi in? If you haven't done anything special you're most likely getting a new ip-address at each reboot.

Have a look in the manual to see how you configure a static dhcp lease. That means that you tell the router to reserve an ip-address which will only be given out to the specific machine, in your case the rpi. This works by looking at the mac-address, which is basically the hardware serial of the network card. To get the mac-address run:

Code: Select all

$ ifconfig|grep "ether "
It's the hexadecimal string that's separated by colons that you want, example (here the mac-address is "12:34:56:78:90:ab"):

Code: Select all

$ ifconfig|grep "ether "
        ether 12:34:56:78:90:ab  txqueuelen 1000  (Ethernet)
- EDIT -
Here's a somewhat generic guide to setting up a statich dhcp lease: http://lifehacker.com/5822605/how-to-se ... ress-again
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive

herbthom
Posts: 19
Joined: Sun Mar 10, 2013 6:10 pm

Re: no network on reboot

Tue Sep 10, 2013 12:19 am

You don't need a static ip address for your alarmp. I'm pretty sure the recent image comes with avahi enabled, so the machine you're sshing from should be able to resolve the name by nss-mdns.

At a console on your Pi:

Code: Select all

$ systemctl | grep -i mdns
avahi-daemon.service        loaded active running   Avahi mDNS/DNS-SD Stack
avahi-daemon.socket         loaded active running   Avahi mDNS/DNS-SD Stack Activation Socket
will confirm that avahi is running. If not, install and enable it.

At a console on the machine where you run ssh:

Code: Select all

$ grep -i mdns /etc/nsswitch.conf
hosts:      files dns mdns4_minimal
should show an mdns* entry in the hosts lists. If not, then you need to install configure - e.g.: 'yum install nss-mdns'.

No need to mess about with dhcp resrevation etc.

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: no network on reboot

Wed Sep 11, 2013 9:40 am

Thanks for your advice, but the problem is not due to a different IP being assigned each time. My router has been configured to assign the same IP to the same mac address each time and the mac address of my raspberry pi is constant. This configuration works for every machine in my house.

Currently, I had to reboot remotely my raspberry pi, and it cannot be accessed anymore by ssh. The router configuration web page says that no device is connected, so I can be sure that no other IP has been assigned by mistake. It seems like the raspi network interface just can't connect...

sdjf
Posts: 1394
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: no network on reboot

Thu Sep 12, 2013 3:13 am

gaggio wrote: - I recently installed a clean archlinux-hf-2013-07-22.img, but the same problem was there with the previous install, and the system is regularly updated
What was the first image you installed? Have you always had this problem or did it just start recently? I ask because I have had good luck with earlier images and not later ones, for my ssh.

And sometimes I do have to restart ethernet manually from a keyboard.

One possible solution is to have some sort of script that runs after rebooting, that would bring up the connection if it does not come up automatically.

gaggio wrote: - I don't have netctl configured, actually I haven't configure anything regarding the network.
You might take a look at what netctl profiles are in your /etc/netctl directory. Make sure that the one that is there fits your circumstances. If you have a static IP address, then you need to use a static ethernet profile. Copy the one from /etc/netctl/examples to /etc/netctl, make it the only one there, giving it whatever name you like, and make sure it has the correct static address in it.
gaggio wrote: - didn't know about sync before reboot, I maybe have to read more about it, but it doesn't seem to be needed nowadays
Hmm, where did you get that idea? It is always wise to sync before reboot as far as I know, not worth the risk of not doing so. Have you run fsck on your partitions? Are they clean?
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: no network on reboot

Mon Sep 16, 2013 11:07 pm

I've been experiencing this problem since last January more or less, now I'm determined to solve it since it's there also after a reinstall and is really annoying...

I tried to configure netctl with a static IP profile, but the same still happens.

I'll run fsck as soon as I get to have someone near the pi to reboot it a couple of times. Also, I probably need to read a bit more about sync!

Thanks!

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: no network on reboot

Tue Sep 17, 2013 12:14 am

Can you add to the profile
SkipNoCarrier=yes
If that fails, what router/whatever make/model do you have?
Make sure only one method connecting network exist

sdjf
Posts: 1394
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: no network on reboot

Tue Sep 17, 2013 4:04 am

Using the sync command should be no big deal, you can look at the man page. All it does is flush the buffers, writing things to disk that are in the queue for that to happen. You don't want to shut the Pi down when that stuff has not been completed, that is why we issue the sync command.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

gaggio
Posts: 22
Joined: Sat Jun 08, 2013 6:44 pm

Re: no network on reboot

Wed Oct 09, 2013 11:25 pm

I finally managed to get my hands on the raspberry and I found that the problem it's quite different to what we were thinking: basically I have an external drive that is always connected and mounted at boot with the auto option on fstab. For some reason this drive is not always recognised at boot, in this case the os boots in single user mode and therefore SSH logins are not allowed...

Now I changed the option to noauto, I have to mount the drive manually and update the NFS exports. This should of course be run into a script, I just need to make sure that the script it's executed it is executed a bit after boot when the drive will be found....

Return to “Arch”