Troubleshooting connection loss (novice question) - Networking

This is a discussion on Troubleshooting connection loss (novice question) - Networking ; On Thu, 01 Nov 2007 02:52:14 GMT, Allen Weiner wrote: > Bit Twister wrote: >> On Wed, 31 Oct 2007 19:27:09 GMT, Bit Twister wrote: >>> Does route -n still show what it does during connection? >> >> Whoops, should ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 38 of 38

Thread: Troubleshooting connection loss (novice question)

  1. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 02:52:14 GMT, Allen Weiner wrote:
    > Bit Twister wrote:
    >> On Wed, 31 Oct 2007 19:27:09 GMT, Bit Twister wrote:
    >>> Does route -n still show what it does during connection?

    >>
    >> Whoops, should read
    >>
    >> Does route -n still show what it does during connection loss that
    >> it did during a good connection?
    >>

    > Regarding your suggestion to turn off the service "avahi-daemon", I
    > forgot to mention in my other reply of Oct. 31 that I checked with the
    > information source I rely on for deletion of unneeded services,
    > "Services in Fedora 7" by Mauriat Miranda (mjmwired.com). It confirms
    > your suggestion, so I've deleted it.


    Another mod to your dump net script.
    You may want to add " | tail -10" to dmesg command

    echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    dmesg | grep eth$nic | tail -10 >> $_out_fn

    echo "======= grep eth$nic /var/log/messages | tail -10 =========" >> $_out_fn
    grep eth$nic /var/log/messages | tail -10 >> $_out_fn

  2. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:

    > Another mod to your dump net script.
    > You may want to add " | tail -10" to dmesg command
    >
    > echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    > dmesg | grep eth$nic | tail -10 >> $_out_fn
    >

    It sure would be worthwhile in my case, with all of those iptables
    messages, to cut limit the size of the report. It seems to me, that the
    worthwhile stuff is at the head of dmesg. Wouldn't | head -10 be the
    better way to go?
    > echo "======= grep eth$nic /var/log/messages | tail -10 =========" >> $_out_fn
    > grep eth$nic /var/log/messages | tail -10 >> $_out_fn


  3. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 03:39:19 GMT, Allen Weiner wrote:
    > Bit Twister wrote:
    >
    >> Another mod to your dump net script.
    >> You may want to add " | tail -10" to dmesg command
    >>
    >> echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    >> dmesg | grep eth$nic | tail -10 >> $_out_fn
    >>


    > It sure would be worthwhile in my case, with all of those iptables
    > messages, to cut limit the size of the report. It seems to me, that the
    > worthwhile stuff is at the head of dmesg. Wouldn't | head -10 be the
    > better way to go?


    I checked fedora's dmesg and saw oct 30 and oct 31 so I picked the
    tail instead of head.

  4. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 03:39:19 GMT, Allen Weiner wrote:
    > Bit Twister wrote:
    >
    >> Another mod to your dump net script.
    >> You may want to add " | tail -10" to dmesg command
    >>
    >> echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    >> dmesg | grep eth$nic | tail -10 >> $_out_fn
    >>

    > It sure would be worthwhile in my case, with all of those iptables
    > messages, to cut limit the size of the report. It seems to me, that the
    > worthwhile stuff is at the head of dmesg. Wouldn't | head -10 be the
    > better way to go?


    Or better yet, " | grep -v Inbound" instead of tail or head.

  5. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 03:39:19 GMT, Allen Weiner wrote:
    >> Bit Twister wrote:
    >>
    >>> Another mod to your dump net script.
    >>> You may want to add " | tail -10" to dmesg command
    >>>
    >>> echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    >>> dmesg | grep eth$nic | tail -10 >> $_out_fn
    >>>

    >> It sure would be worthwhile in my case, with all of those iptables
    >> messages, to cut limit the size of the report. It seems to me, that the
    >> worthwhile stuff is at the head of dmesg. Wouldn't | head -10 be the
    >> better way to go?

    >
    > Or better yet, " | grep -v Inbound" instead of tail or head.


    Looks good:

    [root@localhost ~]# dmesg | grep eth0 | grep -v Inbound
    e100: eth0: e100_probe: addr 0xfc9ff000, irq 11, MAC addr 00:07:E9:01:B2:09
    ADDRCONF(NETDEV_UP): eth0: link is not ready
    e100: eth0: e100_watchdog: link up, 100Mbps, full-duplex
    ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    eth0: no IPv6 routers present

    Also, I rebooted with avahi-daemon turned off. I issued dmesg. There
    were none of those tcp/ip transmissions Multicast DNS to/from port 5353.

  6. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 02:52:14 GMT, Allen Weiner wrote:
    >> Bit Twister wrote:
    >>> On Wed, 31 Oct 2007 19:27:09 GMT, Bit Twister wrote:
    >>>> Does route -n still show what it does during connection?
    >>> Whoops, should read
    >>>
    >>> Does route -n still show what it does during connection loss that
    >>> it did during a good connection?
    >>>

    >> Regarding your suggestion to turn off the service "avahi-daemon", I
    >> forgot to mention in my other reply of Oct. 31 that I checked with the
    >> information source I rely on for deletion of unneeded services,
    >> "Services in Fedora 7" by Mauriat Miranda (mjmwired.com). It confirms
    >> your suggestion, so I've deleted it.

    >
    > Another mod to your dump net script.
    > You may want to add " | tail -10" to dmesg command
    >
    > echo "======== dmesg | grep eth$nic | tail -10 ==========" >> $_out_fn
    > dmesg | grep eth$nic | tail -10 >> $_out_fn
    >
    > echo "======= grep eth$nic /var/log/messages | tail -10 =========" >> $_out_fn
    > grep eth$nic /var/log/messages | tail -10 >> $_out_fn


    What change were you recommending for /var/log/messages? The most recent
    copy of your script that I have, has tail -10 for /var/log/messages. It
    also uses eth0 rather than eth$nic. If I replace the eth0 with eth$nic,
    then the a.txt reports on eth2, but not on eth0. Apparently, the
    /var/log/messages statement is outside of a loop that steps through $nic
    from 0 to 2, and I'm using the leftover value of 2.

    /var/lib/dhclient/dhclient-eth0.leases is not in a.txt. (I added the
    extra line that you gave me.)

    I added the | grep -v Inbound to the dmesg as you suggested. Since I
    reboot every day, I think | head -10 would have been OK for me.


  7. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 15:41:23 GMT, Allen Weiner wrote:
    >>
    >> Another mod to your dump net script.
    >>
    >> echo "======== dmesg | grep eth$nic | grep -v SRC= ======" >> $_out_fn
    >> dmesg | grep eth$nic | grep -v SRC= >> $_out_fn
    >>
    >> echo "======= grep eth$nic /var/log/messages | tail -10 ======" >> $_out_fn
    >> grep eth$nic /var/log/messages | tail -10 >> $_out_fn

    >
    > What change were you recommending for /var/log/messages? The most recent
    > copy of your script that I have, has tail -10 for /var/log/messages. It
    > also uses eth0 rather than eth$nic.


    Sorry, delete the two grep eth0 /var/log/messages lines,

    Those Four lines go inside the for nic loop above the line
    cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic


  8. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 15:41:23 GMT, Allen Weiner wrote:
    >>> Another mod to your dump net script.
    >>>
    >>> echo "======== dmesg | grep eth$nic | grep -v SRC= ======" >> $_out_fn
    >>> dmesg | grep eth$nic | grep -v SRC= >> $_out_fn
    >>>
    >>> echo "======= grep eth$nic /var/log/messages | tail -10 ======" >> $_out_fn
    >>> grep eth$nic /var/log/messages | tail -10 >> $_out_fn

    >> What change were you recommending for /var/log/messages? The most recent
    >> copy of your script that I have, has tail -10 for /var/log/messages. It
    >> also uses eth0 rather than eth$nic.

    >
    > Sorry, delete the two grep eth0 /var/log/messages lines,
    >
    > Those Four lines go inside the for nic loop above the line
    > cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic
    >

    I now have the four lines as you describe, and I deleted the two grep
    eth0 /var/log/messages lines.

    The output now displays /var/log/messages OK. It displays the comment
    line for dmesg but it no longer displays dmesg contents.

    I don't know if this is significant, but look at the change you gave me:

    tail_fn /var/lib/dhcp/dhclient-eth${nic}.leases
    tail_fn /var/lib/dhclient/dhclient-eth{nic}.leases <========
    tail_fn /etc/dhcpc/dhcpcd-eth${nic}.info

    The added line has eth{nic}, not eth${nic} like the other lines (i.e.
    missing $ after nic.

  9. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 17:27:23 GMT, Allen Weiner wrote:
    > Bit Twister wrote:
    >> On Thu, 01 Nov 2007 15:41:23 GMT, Allen Weiner wrote:
    >>>> Another mod to your dump net script.
    >>>>
    >>> What change were you recommending for /var/log/messages? The most recent
    >>> copy of your script that I have, has tail -10 for /var/log/messages. It
    >>> also uses eth0 rather than eth$nic.

    >>
    >> Sorry, delete the two grep eth0 /var/log/messages lines,
    >>
    >> Those Four lines go inside the for nic loop above the line
    >> cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic
    >>

    > I now have the four lines as you describe, and I deleted the two grep
    > eth0 /var/log/messages lines.
    >
    > The output now displays /var/log/messages OK. It displays the comment
    > line for dmesg but it no longer displays dmesg contents.


    Hmmm, show me your code snippet or you can add
    some debugging controls and see what happens. Set commands
    enable/disable debugging.

    set -v
    echo "======== dmesg | grep eth$nic | grep -v SRC= ======" >> $_out_fn
    dmesg | grep eth$nic | grep -v SRC= >> $_out_fn
    set -

    > I don't know if this is significant, but look at the change you gave me:
    >
    > tail_fn /var/lib/dhcp/dhclient-eth${nic}.leases
    > tail_fn /var/lib/dhclient/dhclient-eth{nic}.leases <========
    >
    > The added line has eth{nic}, not eth${nic} like the other lines (i.e.
    > missing $ after nic.


    Yup. needs the $ like the rest I screwed up.
    Sorry, should have booted into Fedora and tested my changes.

    Thank you for the feed back.

  10. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 17:27:23 GMT, Allen Weiner wrote:
    >> Bit Twister wrote:
    >>> On Thu, 01 Nov 2007 15:41:23 GMT, Allen Weiner wrote:
    >>>>> Another mod to your dump net script.
    >>>>>
    >>>> What change were you recommending for /var/log/messages? The most recent
    >>>> copy of your script that I have, has tail -10 for /var/log/messages. It
    >>>> also uses eth0 rather than eth$nic.
    >>> Sorry, delete the two grep eth0 /var/log/messages lines,
    >>>
    >>> Those Four lines go inside the for nic loop above the line
    >>> cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic
    >>>

    >> I now have the four lines as you describe, and I deleted the two grep
    >> eth0 /var/log/messages lines.
    >>
    >> The output now displays /var/log/messages OK. It displays the comment
    >> line for dmesg but it no longer displays dmesg contents.

    >
    > Hmmm, show me your code snippet or you can add
    > some debugging controls and see what happens. Set commands
    > enable/disable debugging.
    >


    While I was editing my copy of the source, I mistyped something and got
    a strange ">>". I believe I corrected the error, but I apologize in
    advance if I didn't.

    Code snippet:

    for nic in 0 1 2 ; do

    if [ -n "$_cmd" ] ; then
    $_cmd eth$nic > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo ======== $_cmd eth$nic ========== >> $_out_fn
    $_cmd eth$nic >> $_out_fn
    fi
    fi

    echo "======== dmesg | grep eth$nic | grep -v Inbound ==========" >>
    $_out_fn
    dmesg | grep eth$nic | grep -v Inbound >> $_out_fn


    echo "======= grep eth$nic /var/log/messages | tail -10 ======" >>
    $_out_fn
    grep eth$nic /var/log/messages | tail -10 >> $_out_fn


    cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic

  11. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 17:27:23 GMT, Allen Weiner wrote:
    >> Bit Twister wrote:
    >>> On Thu, 01 Nov 2007 15:41:23 GMT, Allen Weiner wrote:
    >>>>> Another mod to your dump net script.
    >>>>>
    >>>> What change were you recommending for /var/log/messages? The most recent
    >>>> copy of your script that I have, has tail -10 for /var/log/messages. It
    >>>> also uses eth0 rather than eth$nic.
    >>> Sorry, delete the two grep eth0 /var/log/messages lines,
    >>>
    >>> Those Four lines go inside the for nic loop above the line
    >>> cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic
    >>>

    >> I now have the four lines as you describe, and I deleted the two grep
    >> eth0 /var/log/messages lines.
    >>
    >> The output now displays /var/log/messages OK. It displays the comment
    >> line for dmesg but it no longer displays dmesg contents.

    >
    > Hmmm, show me your code snippet or you can add
    > some debugging controls and see what happens. Set commands
    > enable/disable debugging.
    >
    > set -v
    > echo "======== dmesg | grep eth$nic | grep -v SRC= ======" >> $_out_fn
    > dmesg | grep eth$nic | grep -v SRC= >> $_out_fn
    > set -
    >
    >> I don't know if this is significant, but look at the change you gave me:
    >>
    >> tail_fn /var/lib/dhcp/dhclient-eth${nic}.leases
    >> tail_fn /var/lib/dhclient/dhclient-eth{nic}.leases <========
    >>
    >> The added line has eth{nic}, not eth${nic} like the other lines (i.e.
    >> missing $ after nic.

    >
    > Yup. needs the $ like the rest I screwed up.
    > Sorry, should have booted into Fedora and tested my changes.
    >
    > Thank you for the feed back.


    I added the $ and reran the script. The dhcp stuff showed up, and also
    dmesg content showed up. I doubt that there's a connection between the
    two. So I have no idea why dmesg showed up OK this time. But at least
    for this run, it looks like the script is OK.

  12. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 21:29:41 GMT, Allen Weiner wrote:
    >
    > While I was editing my copy of the source, I mistyped something and got
    > a strange ">>".


    Yep, been there, done that. What I do before I start playing around;
    cp script_fn script_fn.works
    That allows me to have a fallback.works if I realy dink something up.

    Also allows me to do a
    diff -bBw script_fn script_fn.works
    to check changes.



    > I believe I corrected the error, but I apologize in
    > advance if I didn't.


    Well, Up line problems can cause/hide downline problems.


    >
    > echo "====== dmesg | grep eth$nic | grep -v Inbound =====" >> $_out_fn
    > dmesg | grep eth$nic | grep -v Inbound >> $_out_fn
    >
    >
    > echo "===== grep eth$nic /var/log/messages | tail -10 ===" >> $_out_fn
    > grep eth$nic /var/log/messages | tail -10 >> $_out_fn
    >


    Assuming your lines look something like the above I do not see a problem.

    Beside the "set -v" and "set -" debugging commands, you can test commands
    at the command line.

    Assuming you are in a root terminal, you can test each command to see how
    it works. Just cut/paste each line to see what happens:

    nic=0
    dmesg
    dmesg | grep eth$nic
    dmesg | grep eth$nic | grep -v Inbound


    Now to check output to the file:

    _out_fn=a.txt
    cp /dev/null $_out_fn
    cat $_out_fn
    dmesg | grep eth$nic | grep -v Inbound >> $_out_fn
    cat $_out_fn

    If your script is still dinked up, here is new and improved.
    I changed the Inbound for SRC=


    #!/bin/bash
    #******** start of xx.txt script ****************

    _fn=a.txt
    _out_fn=$PWD/$_fn
    _dos_fn=$PWD/dos${_fn}
    _home=$PWD

    function cat_fn
    {
    _fn=$1
    if [ -f $_fn ] ; then
    _count=$(stat -c %s $_fn )
    if [ $_count -gt 0 ] ; then
    echo "======== cat $_fn ==========" >> $_out_fn
    cat $_fn >> $_out_fn
    fi
    fi
    } # end cat_fn

    function grep_fn
    {
    _fn=$1
    if [ -e $_fn ] ; then
    _count=$(stat -c %s $_fn )
    if [ $_count -gt 0 ] ; then
    _count=$(grep -v '^#' $_fn | wc -l)
    if [ $_count -gt 0 ] ; then
    echo "======== grep -v '^#' $_fn ==========" >> $_out_fn
    if [ "$_fn" != "shorewall.conf" ] ; then
    grep -v '^#' $_fn >> $_out_fn
    else
    awk 'empty{if (!/^#/) print; empty=0} /^$/{empty=1}' $_fn >> $_out_fn
    fi
    fi
    fi
    fi
    } # end grep_fn

    function ls_dir
    {
    _dr=$1
    if [ -d $_dr ] ; then
    echo "========= cd $_dr ; ls -al ========" >> $_out_fn
    cd $_dr
    ls -al >> $_out_fn
    fi
    } # end ls_dir

    function tail_fn
    {
    _fn=$1
    if [ -e $_fn ] ; then
    echo "======== tail -18 $_fn ==========" >> $_out_fn
    tail -18 $_fn >> $_out_fn
    fi
    } # end tail_fn

    #********************************
    # check if commands are in $PATH
    # and if not add them path to $PATH
    #********************************

    _path=""
    type ifconfig > /dev/null 2>&1
    if [ $? -ne 0 ] ; then
    _path="${_path}/sbin:"
    fi

    type cat > /dev/null 2>&1
    if [ $? -ne 0 ] ; then
    _path="${_path}/bin:"
    fi

    type id > /dev/null 2>&1
    if [ $? -ne 0 ] ; then
    _path="${_path}/usr/bin:"
    fi

    if [ -n "$_path" ] ; then
    PATH=${_path}$PATH
    export PATH
    fi

    #********************************
    # check if root and logged in correctly
    #********************************

    _uid=$(id --user)

    if [ $_uid -ne 0 ] ; then
    echo " "
    echo "You need to be root to run $0"
    echo "CLick up a terminal and do the following:"
    echo " "
    echo "su - root"
    echo "$PWD/xx"
    exit 1
    fi

    root_flg=1

    if [ -n "$LOGNAME" ] ; then
    if [ "$LOGNAME" != "root" ] ; then
    root_flg=0
    fi
    fi

    if [ -n "$USER" ] ; then
    if [ "$USER" != "root" ] ; then
    root_flg=0
    fi
    fi

    if [ $root_flg -eq 0 ] ; then
    echo " "
    echo "Guessing you did a su root"
    echo "instead of a su - root"
    echo "please exit/logout of this session and do the following:"
    echo " "
    echo "su - root"
    echo "$PWD/xx"
    echo " "
    exit 1
    fi


    #********************************
    # main code starts here
    #********************************


    echo "Working, output will be in $_out_fn "

    date > $_out_fn
    chmod 666 $_out_fn

    if [ -n "$_path" ] ; then
    echo "======== echo $PATH ==========" >> $_out_fn
    echo $PATH >> $_out_fn 2>&1
    fi

    cat_fn /etc/product.id

    echo "======== cat /etc/*release ==========" >> $_out_fn
    cat /etc/*release >> $_out_fn 2>&1

    echo "======== uname -rvi =============" >> $_out_fn
    uname -rvi >> $_out_fn

    echo "======== cat /etc/*version ==========" >> $_out_fn
    cat /etc/*version >> $_out_fn 2>&1

    echo "======== cat /proc/version ==========" >> $_out_fn
    cat /proc/*version >> $_out_fn 2>&1

    type lsb_release > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "======== lsb_release -a ==========" >> $_out_fn
    lsb_release -a >> $_out_fn 2>&1
    fi

    echo " " >> $_out_fn
    if [ -n "$SECURE_LEVEL" ] ; then
    echo "msec security level is $SECURE_LEVEL" >> $_out_fn
    fi

    echo "======== free ==========" >> $_out_fn
    free >> $_out_fn 2>&1

    type chkconfig > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "======== chkconfig --list ==========" >> $_out_fn
    for _serv in avahi named tmdns ; do
    chkconfig --list | grep -i $_serv > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
    chkconfig --list | grep -i $_serv >> $_out_fn
    fi
    done

    chkconfig --list >> $_out_fn

    else
    echo "======== ls -o /etc/rcS.d/ ==========" >> $_out_fn
    for _serv in avahi named tmdns ; do
    ls /etc/rcS.d/S* | grep $_serv > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
    fi
    done

    ls -o /etc/rcS.d >> $_out_fn
    fi

    _fn=/etc/nsswitch.conf
    if [ -e $_fn ] ; then
    echo "======== grep hosts: $_fn ==========" >> $_out_fn
    grep hosts: $_fn >> $_out_fn
    fi

    grep_fn /etc/resolv.conf

    grep_fn /etc/resolvconf/resolv.conf.d/head
    cat_fn /etc/resolvconf/resolv.conf.d/base
    cat_fn /etc/resolvconf/resolv.conf.d/tail


    echo "======== hostname ==========" >> $_out_fn
    hostname >> $_out_fn

    cat_fn /etc/netprofile/profiles/default/files/etc/hosts
    cat_fn /etc/hostname
    cat_fn /etc/HOSTNAME

    ls /etc/mod*.conf > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "======== grep eth /etc/mod*.conf ==========" >> $_out_fn
    grep eth /etc/mod*.conf >> $_out_fn
    fi

    cat_fn /etc/dhclient-enter-hooks
    cat_fn /etc/dhclient-exit-hooks

    grep_fn /etc/host.conf

    echo "================ ifconfig -a ==============" >> $_out_fn
    ifconfig -a >> $_out_fn

    cat_fn /etc/iftab
    cat_fn /etc/udev/rules.d/61-net_config.rules

    echo "============== route -n =================" >> $_out_fn
    route -n >> $_out_fn

    cat_fn /etc/sysconfig/network/routes

    cat_fn /etc/sysconfig/network
    grep_fn /etc/mkinitramfs/initramfs.conf

    echo "========== head -15 /etc/hosts ===========" >> $_out_fn
    head -15 /etc/hosts >> $_out_fn

    cat_fn /etc/network/interfaces
    cat_fn /var/run/network/ifstate


    _cmd=""
    type ethtool > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    _cmd="ethtool"
    fi

    type mii-tool > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    _cmd="mii-tool -v"
    fi

    if [ -z "$_cmd" ] ; then
    echo "====== mii-tool/ethtool NOT INSTALLED ======" >> $_out_fn
    fi

    for nic in 0 1 2 ; do

    if [ -n "$_cmd" ] ; then
    $_cmd eth$nic > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    echo "======== $_cmd eth$nic ==========" >> $_out_fn
    $_cmd eth$nic >> $_out_fn
    fi
    fi

    echo "=== dmesg | grep eth$nic | grep -v SRC= ===" >> $_out_fn
    dmesg | grep eth$nic | grep -v SRC= >> $_out_fn

    echo "=== grep eth$nic /var/log/messages | tail -10 ===" >> $_out_fn
    grep eth$nic /var/log/messages | tail -10 >> $_out_fn

    cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic

    ifconfig eth$nic > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    set $(ifconfig eth$nic | tr [A-Z] [a-z])
    cat_fn /etc/sysconfig/network/ifcfg-eth-id-$5
    fi

    tail_fn /var/lib/dhcp/dhclient-eth${nic}.leases
    tail_fn /var/lib/dhclient/dhclient-eth${nic}.leases
    tail_fn /etc/dhcpc/dhcpcd-eth${nic}.info

    done # end for nic in 0 1 2 ; do

    _dir=/etc/NetworkManager/dispatcher.d
    if [ -d $_dir ] ; then
    ls_dir $_dir

    for _d in "if-up.d" "if-down.d" "if-pre-up.d" "if-post-down.d" ; do
    if [ -e /etc/network/${_d} ] ; then
    echo "==== cd /etc/network/${_d} ; ls -al ===" >> $_out_fn
    cd /etc/network/${_d}
    ls -al >> $_out_fn
    fi
    done
    fi

    if [ -d /etc/sysconfig/network-scripts ] ; then
    for _d in "ifdown.d" "ifup.d" ; do
    if [ -e /etc/sysconfig/network-scripts/${_d} ] ; then
    _cmd="cd /etc/sysconfig/network-scripts/${_d} ; ls -al "
    echo "===== $_cmd ====" >> $_out_fn
    cd /etc/sysconfig/network-scripts/${_d}
    ls -al >> $_out_fn
    fi
    done
    fi

    ls_dir /etc/dhcp3/dhclient-exit-hooks.d
    ls_dir /etc/resolvconf/update.d


    if [ -d /etc/shorewall ] ; then
    _count=$(chkconfig --list shorewall | grep -c n )
    if [ $_count -gt 0 ] ; then
    echo "======= Shorewall settings =========" >> $_out_fn
    cd /etc/shorewall
    for _f in $(ls) ; do
    echo "======= $_f =========" >> $_out_fn
    grep_fn $_f
    done
    fi
    fi


    cd $_home

    grep_fn /etc/hosts.allow
    grep_fn /etc/hosts.deny
    echo "======= end of config/network data dump ===========" >> $_out_fn

    awk '{print $0 "\r" }' $_out_fn > $_dos_fn
    chmod 666 $_dos_fn


    echo " "
    echo "If posting via linux, post contents of $_out_fn"
    echo "You might want to copy it to your account with the command"
    echo "cp $_out_fn ~your_login"
    echo " "
    echo "If posting via windows, post contents of $_dos_fn"
    echo " "
    echo "If using diskette,"
    echo "Copy $_dos_fn to diskette with the following commands:"
    echo " "
    echo "mkdir -p /floppy"
    echo "mount -t auto /dev/fd0 /floppy"
    echo "cp $_dos_fn /floppy"
    echo "umount /floppy "
    echo " "
    echo "and $_dos_fn is ready for windows from diskette"
    echo " "

    #*********** end of dump xx.txt script *********


  13. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Wed, 31 Oct 2007 18:57:59 GMT, Allen Weiner wrote:
    >
    >> The modem DHCP lease time is 24 hours, according to the modem
    >> configuration page. It is 1:0:0:0 (D:H:M:S
    >>
    >> The DHCP lease time according to Fedora is also 24 hours.
    >> (/var/lib/dhclient/dhclient-eth0.leases -> dhcp-lease-time 86400)

    >
    > Well now, nothing so far should cause a drop after a few hours.
    >
    >
    >> Ping 192.168.1.1 following connection loss
    >>
    >> [root@localhost ~]# ping 192.168.1.1
    >> PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    >> From 192.168.1.47 icmp_seq=2 Destination Host Unreachable

    >
    > Does route -n still show what it does during connection?
    >
    >

    route -n after connection loss is the same as during connection.


    I'm looking into changing to static IP. I'm not there yet.

  14. Re: Troubleshooting connection loss (novice question)

    On Thu, 01 Nov 2007 23:47:03 GMT, Allen Weiner wrote:
    > Bit Twister wrote:
    >> On Wed, 31 Oct 2007 18:57:59 GMT, Allen Weiner wrote:
    >>
    >>> The modem DHCP lease time is 24 hours, according to the modem
    >>> configuration page. It is 1:0:0:0 (D:H:M:S
    >>>
    >>> The DHCP lease time according to Fedora is also 24 hours.
    >>> (/var/lib/dhclient/dhclient-eth0.leases -> dhcp-lease-time 86400)

    >>
    >> Well now, nothing so far should cause a drop after a few hours.
    >>
    >>
    >>> Ping 192.168.1.1 following connection loss
    >>>
    >>> [root@localhost ~]# ping 192.168.1.1
    >>> PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    >>> From 192.168.1.47 icmp_seq=2 Destination Host Unreachable

    >>
    >> Does route -n still show what it does during connection?
    >>
    >>

    > route -n after connection loss is the same as during connection.


    Well there was still a route to modem as far as fedora is concerned then.

    Looking more and more like modem is the one dropping the connection.
    That assumes there is no fancy code deciding to block 192.168.1.1
    based on all those firewall packets. I do not run Fedora so I can not
    help in that area.

    I assume you have changed default login/password in your router,
    if it allows you to do so.

    > I'm looking into changing to static IP. I'm not there yet.


    Hey, better to make the ignorant mistake instead of creating a stupid
    problem. It always helps to know something about what you are doing.

    When I feel I am about to do something which can take out the system,
    I'll copy the install into one of my spare partitions, change it's fstab,
    add a line to the boot loader, boot that copy, and play around there.

    For playing with my user account, I have a test account called, junk.
    I'll log into junk and screw around there. If works, make the change
    in bittwister.

  15. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 23:47:03 GMT, Allen Weiner wrote:
    >> Bit Twister wrote:
    >>> On Wed, 31 Oct 2007 18:57:59 GMT, Allen Weiner wrote:
    >>>
    >>>> The modem DHCP lease time is 24 hours, according to the modem
    >>>> configuration page. It is 1:0:0:0 (D:H:M:S
    >>>>
    >>>> The DHCP lease time according to Fedora is also 24 hours.
    >>>> (/var/lib/dhclient/dhclient-eth0.leases -> dhcp-lease-time 86400)
    >>> Well now, nothing so far should cause a drop after a few hours.
    >>>
    >>>
    >>>> Ping 192.168.1.1 following connection loss
    >>>>
    >>>> [root@localhost ~]# ping 192.168.1.1
    >>>> PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    >>>> From 192.168.1.47 icmp_seq=2 Destination Host Unreachable
    >>> Does route -n still show what it does during connection?
    >>>
    >>>

    >> route -n after connection loss is the same as during connection.

    >
    > Well there was still a route to modem as far as fedora is concerned then.
    >
    > Looking more and more like modem is the one dropping the connection.
    > That assumes there is no fancy code deciding to block 192.168.1.1
    > based on all those firewall packets. I do not run Fedora so I can not
    > help in that area.
    >
    > I assume you have changed default login/password in your router,
    > if it allows you to do so.
    >


    Yes, I changed the password on the modem/router.

    I'm up and running with static IP, so we'll see what happens with
    connection loss.

    You may have missed my post today where I reported that my copy of your
    script is now running OK including dmesg and dhcp.

    Thanks for your help.

  16. Re: Troubleshooting connection loss (novice question)

    On Fri, 02 Nov 2007 01:57:10 GMT, Allen Weiner wrote:
    >
    > I'm up and running with static IP, so we'll see what happens with
    > connection loss.
    >
    > You may have missed my post today where I reported that my copy of your
    > script is now running OK including dmesg and dhcp.


    Nope, caught it, hope you saw the response and have the updated script.

    Thanks for your time playing with it.

  17. Re: Troubleshooting connection loss (novice question)

    Bit Twister wrote:
    > On Thu, 01 Nov 2007 21:29:41 GMT, Allen Weiner wrote:
    >> While I was editing my copy of the source, I mistyped something and got
    >> a strange ">>".

    >
    > Yep, been there, done that. What I do before I start playing around;
    > cp script_fn script_fn.works
    > That allows me to have a fallback.works if I realy dink something up.
    >
    > Also allows me to do a
    > diff -bBw script_fn script_fn.works
    > to check changes.
    >
    >
    >
    >> I believe I corrected the error, but I apologize in
    >> advance if I didn't.

    >
    > Well, Up line problems can cause/hide downline problems.
    >
    >
    >> echo "====== dmesg | grep eth$nic | grep -v Inbound =====" >> $_out_fn
    >> dmesg | grep eth$nic | grep -v Inbound >> $_out_fn
    >>
    >>
    >> echo "===== grep eth$nic /var/log/messages | tail -10 ===" >> $_out_fn
    >> grep eth$nic /var/log/messages | tail -10 >> $_out_fn
    >>

    >
    > Assuming your lines look something like the above I do not see a problem.
    >
    > Beside the "set -v" and "set -" debugging commands, you can test commands
    > at the command line.
    >
    > Assuming you are in a root terminal, you can test each command to see how
    > it works. Just cut/paste each line to see what happens:
    >
    > nic=0
    > dmesg
    > dmesg | grep eth$nic
    > dmesg | grep eth$nic | grep -v Inbound
    >
    >
    > Now to check output to the file:
    >
    > _out_fn=a.txt
    > cp /dev/null $_out_fn
    > cat $_out_fn
    > dmesg | grep eth$nic | grep -v Inbound >> $_out_fn
    > cat $_out_fn
    >
    > If your script is still dinked up, here is new and improved.
    > I changed the Inbound for SRC=
    >
    >

    Just out of curiosity, what is the reason for changing Inbound to SRC?

    Your script gives me a good impetus to improve my knowledge of BASH
    scripting. Ethtool runs OK with my NIC.If time permits, I will look at
    your script and see if I can get the ethtool report running.



  18. Re: Troubleshooting connection loss (novice question)

    On Fri, 02 Nov 2007 18:17:28 GMT, Allen Weiner wrote:
    >>

    > Just out of curiosity, what is the reason for changing Inbound to SRC?


    More better. :-)

    SRC= will work on an Inbound and an Outbound record.


    > Your script gives me a good impetus to improve my knowledge of BASH
    > scripting. Ethtool runs OK with my NIC.If time permits, I will look at
    > your script and see if I can get the ethtool report running.


    If you get Ethtool to work, just move the
    type ethtool > /dev/null 2>&1
    if [ $? -eq 0 ] ; then
    _cmd="ethtool"
    fi

    below the test for mii-tool

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2