Eth lost after 12+ hours of inactivity

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Eth lost after 12+ hours of inactivity

Postby nuxnik » Fri Nov 28, 2014 2:36 pm

Running Linux-raspberry pi 3.12.28-2

After about 12+ hours of no activity, the Ethernet connection is lost

A ping to another device or router gives "network unreachable"

From a different machine, this is what shows
$this->bbcode_second_pass_code('', '
spim@Opt1:~$ ping -c 4 192.168.0.14
PING 192.168.0.14 (192.168.0.14) 56(84) bytes of data.
From 192.168.0.18 icmp_seq=1 Destination Host Unreachable
From 192.168.0.18 icmp_seq=2 Destination Host Unreachable
From 192.168.0.18 icmp_seq=3 Destination Host Unreachable
From 192.168.0.18 icmp_seq=4 Destination Host Unreachable
')

All devices on this (home) network have assigned IP addresses.
My neighborhood seems popular for wardriving, and therefore I'm trying to strictly control access by hard assigned IP by the router, and no random DHCP assignment.

Rebooting the Raspberry Pi solves the problem until the next time

NOTE #1:
The other IP address in the ping is the address of the sending device
NOTE #2:
I do not have this problem running Raspian, so that eliminates hardware as a problem.
nuxnik
 
Posts: 11
Joined: Mon Oct 27, 2014 8:27 pm

Re: Eth lost after 12+ hours of inactivity

Postby sdjf » Sun Nov 30, 2014 2:04 am

Post the output of route and ifconfig the next time this happens.

The way I keep this from happening is to add an ifconfig command to a script that I have running on the pi, anyhow, to make sure that ethernet access continues to be enabled.

Example (the IP address should be the address of the Host, and I run one ifconfig command for each network):
$this->bbcode_second_pass_code('', '
ifconfig eth0 192.168.xxx.xx netmask 255.255.255.0 up 2> /dev/null
')
The devices that access my Pi are PDAs that "go to sleep" and the Pi cleans house by dropping connectivity. Since my script loops every minute or so, I know that about a minute after one of the PDAs "wakes up", ethernet will be back up on the network it needs to access.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Eth lost after 12+ hours of inactivity

Postby nuxnik » Tue Dec 02, 2014 3:06 am

Route is:

$this->bbcode_second_pass_code('', '
[root@raspi ~]# cat route.txt
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
[root@raspi ~]#
')

ifconfig is:

$this->bbcode_second_pass_code('', '
[root@raspi ~]# cat ifconfig.txt
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fd00::ba27:ebff:fe94:659 prefixlen 64 scopeid 0x0<global>
inet6 fe80::ba27:ebff:fe94:659 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:94:06:59 txqueuelen 1000 (Ethernet)
RX packets 54815 bytes 3999214 (3.8 MiB)
RX errors 0 dropped 17 overruns 0 frame 0
TX packets 8689 bytes 1447948 (1.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 178 bytes 13822 (13.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 178 bytes 13822 (13.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@raspi ~]#
')
nuxnik
 
Posts: 11
Joined: Mon Oct 27, 2014 8:27 pm

Re: Eth lost after 12+ hours of inactivity

Postby sdjf » Tue Dec 02, 2014 9:39 pm

I think you need to run an ifconfig command as I gave example above, in order to enable access. Ethernet is running, but ifconfig is needed to bring access to the network you need back up.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Eth lost after 12+ hours of inactivity

Postby nuxnik » Wed Dec 03, 2014 1:57 pm

Thank you.

I set that up
We'll see if it works

Now the question is why is this happening with Arch Linux, but not with Raspian ?
Where can I find the difference that causes this loss of routing (?) ??
Because clearly there is something in Arch Linux that somehow forgets.

Since I want to avoid assigning IPs in the OS install by having the router hand out the assigned IP addresses, your solution also forces me to put a dedicated command into the install, which again makes the the system more complex and less clonable. (I now have something I need to change before a clone is ready to run on it's own..)
nuxnik
 
Posts: 11
Joined: Mon Oct 27, 2014 8:27 pm

Re: Eth lost after 12+ hours of inactivity

Postby sdjf » Wed Dec 03, 2014 7:47 pm

For that question, you might search and post a query on the Networking and Server subforum at the foundation, where there ought to be more people who know both systems.

Raspberry Pi • View forum - Networking and servers
http://www.raspberrypi.org/forums/viewforum.php?f=36

Not sure, but I would guess that would be a better place to get more input. I don't know Raspbian, I am happy with Arch and don't have any need to learn Raspbian.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Eth lost after 12+ hours of inactivity

Postby sdjf » Thu Dec 04, 2014 1:21 am

One more thought. I think it is totally possible to write a sort script that would loop every few hours (if that is what you want) which uses the contents of an environment variable or the output of ifconfig or route when ethernet is active, to determine that particular installation's IP address. You would not have to hard code in the actual address.

I would be interested to learn what the alternative method is that Raspbian uses, if you find out. I might just switch to that if it is more efficient.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 79 guests