Re: Troubleshooting connection loss (continued)
- From: Bit Twister <BitTwister@xxxxxxxxxxxxxxxx>
- Date: Mon, 12 Nov 2007 05:12:30 GMT
On Mon, 12 Nov 2007 04:46:20 GMT, Allen Weiner wrote:
Bit Twister wrote:
Are the majority of the disconnects happening "approximately 2 hours"
after the modem is powered up?
It seems that way. But I haven't kept a log book.
My guess, is there might be a loose connection inside the modem.
You power up, about 2hrs later, heat causes the problem. little while
later the heat makes the connection go back together.
Imagin a loose sodder connection on a pin. Sorry for the bad graphics.
cold connection (* ) works
warm connection ( * ) breaks
warmer connection ( *) working again
connection in this context is physical connection.
So, I doubt that that strange first line with the leading semicolon is
causing a problem.
Well I am happy, you have learned all you need to know.
Guess we are done.
Here is a present to play with.
--------------- script starts below this line ----------------
#!/bin/bash
#*****************************************************************
#*
#* ck_connection - Check internet connection.
#*
#*
#* Install procedure:
#* Save into a file named ck_connection
#* actual location should be somewhere in $PATH
#* chmod +x ck_connection
#*
#*
#* Code walks through the png array to test each point
#* in the path to/though the internet. DNS are also tested.
#*
#* You will need to modify the script to use system's gateway
#* and insert the ISP's gateway value.
#*
#* You may have to get into the modem's web page to find
#* the modem's gateway (ISP's gateway) for the modem.
#*
#* Depending on your distribution, the $(hostname -s) and
#* $(hostname) may need changing.
#*
#* On Mandriva linux hostname returns the FQDN and
#* hostname -s returns the short name for the node.
#*
#*****************************************************************
function net_info {
cat <<EOF
There are settings which define where and what for DNS search order.
In the following, I'll give commands, results and maybe comments.
The command line starts with a $ so you can tell it from results and
my comments. You do not use the leading $ when you run the command.
You can get more help about the command with
man first_word_here
Example: you would do a man grep to get grep command manual.
The commands and example values follow:
$ grep hosts: /etc/nsswitch.conf
hosts: files dns nis
For speed, mine has
hosts: files dns
$ grep -v '^#' /etc/host.conf
order hosts,bind
multi on
nospoof on
spoofalert on
$ grep -v '^#' /etc/resolv.conf
nameserver 192.168.0.0
nameserver 0.238.0.12
nameserver 0.203.0.86
For speed improvements, I alwasy remove any search or domain lines.
Do not use the above numbers on your system. They are examples only.
If a nameserver fails to return anything, the next server is tried.
Because of that, I like to have the last server to be my ISP's public DNS
For routing check, there is
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 10 0 0 eth0
In the above, UG in the Flags column indicate that line will be used
as the default Gateway route to ip addresses that can not be routed
via the lines above it.
The ip address in the Gateway column is where that traffic is sent.
If you can ping that address, you know that device is alive and
packets are leaving your node.
$ ifconfig
will allow you to see the ip address assigned to your nic and allow you
to check if you are getting unreasonable counts for errors, dropped,
overruns, frame, carrier and collisions.
If you want to check internet speeds to somewhere, Example:
$ traceroute -n yahoo.com
Some nodes drop those trace packets, so you may want to use
$ traceroute -In yahoo.com
For dns testing there is something like
$ dig google.com @isp_name_server1
You will get information about how isp_name_server1 performed
researching google.com lookup .
EOF
} # end net_info
#********************************************
#*
#* The following are not acutal checks
#* The comment box is about what the ping value
#* will be used to make what check/verification.
#*
#* You will need to make changes to match your setup.
#* If you want to skip a test you either put
#* 127.0.0.1 in the png[x] test to skip.
#*
#* Or you delete the png[] and msg[] lines,
#* and renumber them to keep the numbers continuous
#* through the png[12]="done" line.
#*
#* NOTE:
#* The png[12]="done" line has to remain and
#* must be the last one in the png array.
#*
#* When renumbering, check the msg[] text to verify
#* if there is a png[] value used in the text.
#*
#* You will also have to fix the code whcih
#* uses png[9].
#*
#********************************************
#********************************************
#* check ping works on the node
#********************************************
png[1]="127.0.0.1"
msg[1]="$(hostname -s) problem,
No idea where to look, I never had the problem
"
#********************************************
#* check dns on my node
#********************************************
png[2]="localhost"
msg[2]="Check $(hostname -s) /etc/hosts localhost line.
I assume you have a line like
127.0.0.1 localhost.localdomain localhost
man hosts for more info"
#********************************************
#* check pinging my ip address works
#********************************************
png[3]="192.168.1.130"
msg[3]="Check $(hostname -s) /etc/hosts $(hostname) ip addy.
I assume you have a line like
192.168.1.130 $(hostname) $(hostname -s)
man hosts for more info"
#********************************************
#* check dns reads my /etc/hosts by full name
#********************************************
png[4]="$(hostname)"
msg[4]="Check $(hostname -s) /etc/hosts $(hostname) line.
I assume you have a line like
192.168.1.130 $(hostname) $(hostname -s)
man hosts for more info"
#********************************************
#* check dns reads my /etc/hosts by alias
#********************************************
png[5]="$(hostname -s)"
msg[5]="Check $(hostname -s) /etc/hosts $(hostname) line for an alias.
I assume you have a line like
192.168.1.130 $(hostname) $(hostname -s)
man hosts for more info"
#********************************************
#* check my gatway device is alive
#********************************************
png[6]="192.168.1.1"
msg[6]="Check physical connection to next device to internet (gateway).
run mii-tool -v eth0
or ethtool eth0
You are looking for link ok line
or Link detected: yes depending on which tool used
run route -n to verify you have a UG Flags line
$(net_info)"
#********************************************
#* check my gatway alias in /etc/hosts
#********************************************
png[7]="router"
msg[7]="Check $(hostname -s) /etc/hosts router line
I assume you have a
192.168.1.1 router line
man hosts for more info
$(net_info)"
#********************************************
#* check my ISP's gateway connected to router
#********************************************
png[8]="71.252.137.1"
msg[8]="Check leds on internet device.
poweroff internet device (adsl/cable modem)
wait 30 seconds by watch/clock to let capacitors discharge
and reset device
power up, wait for leds to settle down
run service network restart
Leds not right, check wiring out to telephone pole
call your ISP
$(net_info)"
#********************************************
#* check if DNS server is alive
#********************************************
_dns_ip=9
png[$_dns_ip]="192.168.1.1"
msg[$_dns_ip]="Check $(hostname -s) /etc/resolv.conf nameserver line
You will have to check the device which has the name server running.
Your internet device (adsl/cable modem your dns server)
If none of the above, ${png[$_dns_ip]} is down
Work around, change namesever ip_here to a public nameserver
in /etc/resolv.conf
man resolv.conf for more info
$(net_info)"
#********************************************
#* check ISP can route to yahoo.com
#********************************************
png[10]="66.94.234.13"
msg[10]="cannot ping yahoo by ip address
yahoo.com is down or ip address changed.
check google.com with ping -c1 72.14.207.99
If that fails, google.com is down or ip address changed
or it is an ISP/internet problem
$(net_info)"
#********************************************
#* check DNS can resolve yahoo.com
#********************************************
png[11]="yahoo.com"
msg[11]="Cannot ping yahoo.com by name
yahoo.com just went down, or dns is broke on your ISP or somewhere else.
$(net_info)"
png[12]="done"
msg[12]="Last array element to tell while loop we are done pinging"
#********************************************
#* Actual testing starts here
#********************************************
#********************************************
#* get the first dns server from /etc/reso.conf
#********************************************
set -- $(grep nameserver /etc/resolv.conf | grep -v '^#' | head -1)
_ip=$2
if [ -z "$_ip" ] ; then
echo "/etc/resolv.conf does not have a nameserver line.
man resolv.conf
for more information"
exit 1
else
pgn[$_dns_ip]=$_ip
fi
#********************************************
#* loop through all ip/name tests
#********************************************
i=1
while [ "${png[$i]}" != "done" ] ; do
echo "running ping -c 1 -w 3 ${png[$i]} "
ping -c 1 -w 3 ${png[$i]} > /dev/null
if [ $? -ne 0 ] ; then
/bin/echo -e "\nFailure: ping -c 1 -w 3 ${png[$i]} "
/bin/echo -e "${msg[$i]} "
exit 1
fi
i=$i+1
done
#********************************************
#* loop through all nameservers in /etc/resov.conf
#********************************************
while read line
do
set -- $line
_ip=$2
if [ "$1" = "nameserver" ] ; then
echo "running ping -c 1 -w 3 $_ip "
ping -c 1 -w 3 $_ip > /dev/null
if [ $? -ne 0 ] ; then
/bin/echo -e "\nDNS nameserver Failure: ping -c 1 -w 3 $_ip "
echo "nameserver $_ip in /etc/resolv.conf is not responding to pings."
echo "$(net_info)"
exit 1
fi
fi
done < /etc/resolv.conf
#********* end ck_connection **********************************
.
- Follow-Ups:
- Re: Troubleshooting connection loss (continued)
- From: Allen Weiner
- Re: Troubleshooting connection loss (continued)
- References:
- Troubleshooting connection loss (continued)
- From: Allen Weiner
- Re: Troubleshooting connection loss (continued)
- From: Bit Twister
- Re: Troubleshooting connection loss (continued)
- From: Allen Weiner
- Re: Troubleshooting connection loss (continued)
- From: Timothy Murphy
- Re: Troubleshooting connection loss (continued)
- From: Bit Twister
- Re: Troubleshooting connection loss (continued)
- From: Allen Weiner
- Re: Troubleshooting connection loss (continued)
- From: Bit Twister
- Re: Troubleshooting connection loss (continued)
- From: Allen Weiner
- Re: Troubleshooting connection loss (continued)
- From: Bit Twister
- Re: Troubleshooting connection loss (continued)
- From: Allen Weiner
- Troubleshooting connection loss (continued)
- Prev by Date: Re: Troubleshooting connection loss (continued)
- Next by Date: anybody knows how to disable outbound icmp destination unreachable message
- Previous by thread: Re: Troubleshooting connection loss (continued)
- Next by thread: Re: Troubleshooting connection loss (continued)
- Index(es):
Relevant Pages
|