Sign in to follow this  
bhelgeson

5.1 Network dropped How to restart

Recommended Posts

This morning after days of this unit running the bonded network connection was dead. The console was live. All services seemed to be running in top however the network services were dead. How does one restart network in this build. And any idea why this would happen?

 

A reboot brought the network and NAS live again.

 

Thanks,

Bill

Share this post


Link to post
Share on other sites

Update after reboot network was up and then dropped again. I am running on a Readynas Pro6. I am reverting to 5.0 and see if the issue goes away. This is an lcap bond and the switch does show both nics off line.

 

Bill

Share this post


Link to post
Share on other sites

I had a similar problem with 5.0 and resorted to writing a script that was chronned to run every 5 minutes. If interested, I'll post it later.

 

as root...

 

ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 up
ifconfig eth1 up

 

Mine was dropping IPv4, but IPv6 was still up, which didn't help me trying to connect to it via an ipv4 address.

I only needed the eth0 up/down commands for my single interface. Not sure how this will work on the bonded interface, but it's worth a shot.

 

use ifconfig and see what kind of errors you get. That will help in determining what is going on. It may be a similar problem.

ex:

use this when the problem is happening

ifconfig > /tmp/linkdown

 

and this when it's working fine.

ifconfig > /tmp/linkup

 

Compare the results. This helped me discover that the link was still up, but that IPv4 had dropped for some reason.

 

EDIT: Added script and text below.

This is a script I wrote. Originally I ran a version of it in one of my newznab scripts, but then just sourced it and chronned it for every 5 minutes.

You'll need to edit it for your bonded link and change it to look for your particular problem, but it if resetting eth0 and eth1 fixes it for you, this might work.

 

One more item. I just realized that the bonded link might create something like eth2. If that's the case, try resetting only that or if that doesn't work, a combination of the three. Again, compare what ifconfig reports when it is down and when it is up.

 

I don't really have a lot of experience writing shell scripts, so this may look a little amateur-ish

If it detects a problem (ifconfig says I don't have an IP address), it bounces eth0 and then checks again and logs the reported ip to a log file.

 

linkcheck.sh

#!/bin/sh
# testing for connectivity and bouncing link if there is a problem
#replace below with your ip address
export MY_IP="192.168.11.222"
lc_LOGFILE=/var/log/linkcheck.log
# set to /dev/null for no logging
checkEthx() {
export lc_ETH="eth0"
export lc_IP_ADDR="192.168.11.222"
export lc_REPORTED_IP=`ifconfig $ETH|grep "$lc_IP_ADDR"|awk -F':+| +' '{print $4}'`
export LOGGER_CMD="/usr/bin/logger"
# echo Reported: $REPORTED_IP
# echo Actual:   $IP_ADDR
if [ -z $lc_REPORTED_IP ]
then
       echo "Problem detected at `date`: IPV4 is down ">>$lc_LOGFILE
       ifconfig $lc_ETH down
       sleep 1
       ifconfig $lc_ETH up
       # run again to (hopefully) set the variable to a reported IP that matches with our known working IP
       export lc_REPORTED_IP=`ifconfig $lc_ETH|grep "$lc_IP_ADDR"|awk -F':+| +' '{print $4}'`
       echo "Logging results of ping: `ping -c1 -q $lc_IP_ADDR`">>$lc_LOGFILE
       echo "logging last result or lc_REPORTED_IP ** $lc_REPORTED_IP ** ">>$lc_LOGFILE
       $LOGGER_CMD -t LINKCHECK "REPORTED_IP was $lc_REPORTED_IP"
       $LOGGER_CMD -t LINKCHECK "lc_IP_ADDR  is  $lc_IP_ADDR"
       $LOGGER_CMD -t LINKCHECK "PING RESULT was `ping -c1 -q $lc_IP_ADDR`"
#else
#       $LOGGER_CMD -t LINKCHECK "Link OK at `date` "
#       echo "LINK OK `date` $lc_REPORTED_IP">>$lc_LOGFILE
fi
}
# call once - also added for command line compatibility, since this is sourced into another script for the function.
#
checkEthx

Share this post


Link to post
Share on other sites

Very interesting. I only have this issue if I put 8 GB ram into the unit. Reverted back to 4GB and this does not happen. I will put the 8GB back into the unit and see if I still have the same issue.

 

Will try your script after I get back in town, traveling currently, and add the RAM.

 

Thanks,

Bill

Share this post


Link to post
Share on other sites
Sign in to follow this