LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2008, 01:35 PM   #1
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Rep: Reputation: 30
default gateway deletes itself


what might be the cause for the default gateway to delete itself ? I have to constantly do route add default to keep it there
 
Old 09-21-2008, 01:40 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
What distro are you using?
 
Old 09-21-2008, 02:18 PM   #3
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
I was hoping that would be irrelevant, it's Arch, but soon I am going LFS.

aren't there any general pointers, directions ?
 
Old 09-21-2008, 02:43 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Possibly you could write a one-line script with your 'route add' command and put it in /etc/init.d/
Then create a symbolic link to your runlevel (assuming that you boot into runlevel 5)
Quote:
ln -s /etc/init.d/myscript /etc/rc.d/rc5.d/S40myscript
I'm not sure if you can have 2 entries with the same number, so if you already have some other script starting with S40,
change the name of your script to e.g. S41.

It may not be the best solution, but it SHOULD work
 
Old 09-21-2008, 02:44 PM   #5
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Are you using dhcp?
 
Old 09-21-2008, 03:04 PM   #6
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
here is the specific configuration
eth0: dhcp cable modem connection
eth1: local static connection
ppp0: pptp on top of cable connection

I have set defaultroute in my ppp file but it maybe effective only when the connection starts, it apperantly does not re-set it if it disappears

will what you are suggesting means that it will just override the default gateway even if it fails ? or run only once ? I have perhaps done better than that, I have added that to rc.sysinit, but the problem is that it re-deletes itself every time every 10 or so minutes

I have an alternative temporary method by adding a cron job to run that command every minute, but I hope someone could help me avoid it

Last edited by monohouse; 09-21-2008 at 03:09 PM.
 
Old 09-21-2008, 03:56 PM   #7
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
Well, I have this in my root crontab: */12 * * * * /usr/local/sbin/renew-default-route

and /usr/local/sbin/renew-default-route contains this:
#! /bin/sh
# Make sure the default route to our dsl router is set
# Our dsl network (static) is: 64.216.205.120/29 (gw == 126)
# D.R. Forrest 9/14/08

/sbin/route |/bin/grep default &> /dev/null || {
/sbin/route add default gw 64.216.205.126
/bin/echo "Default route added" | /bin/mail -s "Default route missing" root
}

This places a default route if missing (several times a minute) and sends me an email. It's been running for a couple of weeks and no mail yet. But the route was lost in a momentary power glitch during the passage of the storm Ike, and caused me some grief. I've tested the script by bringing my modem down and it seems to work. But no promises given here.

Dave
 
Old 09-21-2008, 04:40 PM   #8
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
I have just read this in the everything.log

Quote:
Code:
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45805 (expecting 45738, lost or reordered)
Sep 22 02:58:38 myhost pppd[11015]: No response to 2 echo-requests
Sep 22 02:58:38 myhost pppd[11015]: Serial link appears to be disconnected.
Sep 22 02:58:38 myhost pppd[11015]: Connect time 4.0 minutes.
Sep 22 02:58:38 myhost pppd[11015]: Sent 3346316 bytes, received 29809041 bytes.
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45806 (expecting 45738, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45807 (expecting 45738, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45808 (expecting 45738, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45809 (expecting 45738, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45810 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45811 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45812 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45813 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45814 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45815 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45816 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45817 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45818 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45819 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45820 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45821 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45822 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45823 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45824 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pptp[14743]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 45825 (expecting 45782, lost or reordered)
Sep 22 02:58:38 myhost pppd[11015]: Connection terminated.
Sep 22 02:58:39 myhost pppd[11015]: Using interface ppp0
Sep 22 02:58:39 myhost pppd[11015]: Connect: ppp0 <--> /dev/pts/2
Sep 22 02:58:39 myhost pptp[14746]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Sep 22 02:58:39 myhost pptp[14743]: anon warn[decaps_hdlc:pptp_gre.c:197]: short read (-1): Input/output error
Sep 22 02:58:39 myhost pptp[14743]: anon warn[decaps_hdlc:pptp_gre.c:209]: pppd may have shutdown, see pppd log
Sep 22 02:58:39 myhost pptp[14746]: anon log[callmgr_main:pptp_callmgr.c:231]: Closing connection (unhandled)
Sep 22 02:58:39 myhost pptp[14746]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Sep 22 02:58:39 myhost pptp[14761]: anon log[main:pptp.c:276]: The synchronous pptp option is NOT activated
Sep 22 02:58:39 myhost pptp[14746]: anon log[ctrlp_disp:pptp_ctrl.c:857]: Received Outgoing Call Reply.
Sep 22 02:58:39 myhost pptp[14746]: anon log[ctrlp_disp:pptp_ctrl.c:896]: Outgoing call established (call ID 1, peer's call ID 29354).
Sep 22 02:58:39 myhost pptp[14746]: anon log[ctrlp_disp:pptp_ctrl.c:928]: Call disconnect notification received (call id 29344)
Sep 22 02:58:40 myhost pppd[11015]: PAP authentication succeeded
Sep 22 02:58:40 myhost pppd[11015]: kernel does not support PPP filtering
Sep 22 02:58:40 myhost pppd[11015]: local  IP address 217.22.120.33
Sep 22 02:58:40 myhost pppd[11015]: remote IP address 217.22.120.1
Sep 22 02:58:40 myhost pppd[11015]: primary   DNS address 217.22.119.11
Sep 22 02:58:40 myhost pppd[11015]: secondary DNS address 217.22.113.251
Sep 22 02:58:42 myhost pptp[14761]: anon log[decaps_gre:pptp_gre.c:407]: buffering packet 137 (expecting 136, lost or reordered)
indicates that the pptp connection disconnects every few minutes, but I have no idea what might be the cause of that
 
Old 09-21-2008, 05:07 PM   #9
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
also, it appears that the interface on which the tunnel runs haas errors:

Code:
eth0      Link encap:Ethernet  HWaddr 00:06:4F:02:B0:3C  
          inet addr:172.26.121.69  Bcast:255.255.255.255  Mask:255.255.224.0
          UP BROADCAST RUNNING MULTICAST  MTU:1400  Metric:1
          RX packets:5564039 errors:76524 dropped:0 overruns:0 frame:0
          TX packets:3747065 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2577807170 (2458.3 Mb)  TX bytes:762917413 (727.5 Mb)
          Interrupt:5 Base address:0xa000
why are there errors ?
 
Old 09-21-2008, 05:25 PM   #10
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
That's a lot of errors. First replace the cable and monitor for errors again.
 
Old 09-21-2008, 05:41 PM   #11
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
do you meen to tell me that there is a problem with the physical connection ? im gonna do it and see how it turns out

there appear to be errors on the eth1 interface as well

Code:
eth1      Link encap:Ethernet  HWaddr 00:0A:CD:0B:DA:CF  
          inet addr:1.0.0.1  Bcast:1.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3437480 errors:12188 dropped:0 overruns:0 frame:0
          TX packets:3729088 errors:0 dropped:0 overruns:7 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:625852343 (596.8 Mb)  TX bytes:2551379416 (2433.1 Mb)
          Interrupt:7 Base address:0xc000
how could both cables be bad ?
http://linux.derkeiler.com/Newsgroup.../msg01524.html
this may be relevant, it's possible that because I used ethtool to set the necessary modes, the auto negotiation in the switch is not off, I suspect that if that is the case, it is nothing to be concerned about, because this is unlikely the reason for the disconnection of the pptp connection, the eth1/0 interfaces never disconnected before, but I was worried that this was an error in the packets themselves.

where can I see the number of retransmissions of packets on each interface ?

Last edited by monohouse; 09-21-2008 at 05:52 PM.
 
Old 09-21-2008, 05:53 PM   #12
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
It could be both cables. Most folks don't know there are very tight requirements for Ethernet cables. They crimp, kink, crush, or buy poorly built cables and have unexplained networking problems. I've had clients who literally had cables all over the floor, crushed, tightly folded, and couldn't understand why there were so many Ethernet errors! I ultimately setup an entire server data center for one client.

Your errors should be essentially 0, even after months of uptime.
 
Old 09-21-2008, 05:57 PM   #13
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
The interface driver may provide the statistics, which can be viewed with ethtool. netstat also provides some statistics via the -s option.
 
Old 09-21-2008, 05:59 PM   #14
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I'm not sure I follow you re: what you configured in ethtool. Show ethtool output for the interfaces.
 
Old 09-21-2008, 06:10 PM   #15
monohouse
Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 206

Original Poster
Rep: Reputation: 30
Code:
# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: No
        Speed: 10Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes
Code:
# ethtool -S eth0
NIC statistics:
     early_rx: 0
     tx_buf_mapped: 0
     tx_timeouts: 0
     rx_lost_in_ring: 0
Code:
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes
Code:
# ethtool -S eth1
NIC statistics:
     early_rx: 0
     tx_buf_mapped: 0
     tx_timeouts: 0
     rx_lost_in_ring: 0
if thee problem is really in the cables, why are there 0 TX errors on both interfaces ? wouldn't it be right to assume that because I turned off auto negotiation the switch and the modem are sending auto negotiation frames and the interface does not receive them ? I can try to turn on auto negotiation and see the effect it has on the errors

Last edited by monohouse; 09-21-2008 at 06:18 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default gateway dooda5555 Linux - Networking 1 06-17-2005 11:43 AM
HELP default gateway MrSavage Linux - Newbie 2 01-10-2005 07:46 AM
Default Gateway rrosenkoetter Linux - Networking 3 08-27-2004 08:41 AM
default gateway avikosan Linux - Networking 3 12-09-2003 05:47 PM
What's a default gateway and do I need one? Travis86 Linux - Newbie 8 05-25-2003 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration