LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2005, 03:32 AM   #1
rubella
Member
 
Registered: Sep 2005
Location: Europe
Distribution: debian sarge
Posts: 65

Rep: Reputation: 15
lost my routes?!?


Could someone tell me why i lost my self-added routes on my gateway?

4 days ago, i added the following routes:
ip r a 192.168.77.0/24 via 192.168.1.72 dev ppp0
ip r a 192.168.78.0/24 via 192.168.1.72 dev ppp0

Today, without any reason (for me ), they where gone... no reboot, nothing special.

Can i add them permanently to my box? i've read 'man ip' but i don't see something like 'route add -p' like we know on windows... thx guys!
 
Old 11-22-2005, 08:52 AM   #2
prabuayyappan
Member
 
Registered: Sep 2005
Location: Coimbatore
Distribution: Prabuayyappan
Posts: 32

Rep: Reputation: 15
route add -net 192.168.77.0/24 gw 192.168.1.72 dev ppp0
route add -net 192.168.78.0/24 gw 192.168.1.72 dev ppp0

add this to /etc/rc.d/rc.local
 
Old 11-22-2005, 08:55 AM   #3
rubella
Member
 
Registered: Sep 2005
Location: Europe
Distribution: debian sarge
Posts: 65

Original Poster
Rep: Reputation: 15
but... he will only replace routes when i reboot or something like that? i never reboot the machine... or is this something like cron, runnign daily or something else? anyway, thx for your comment, i'll check it out...

and a second question: Does someone know why i lost those routes?
 
Old 11-22-2005, 09:21 AM   #4
prabuayyappan
Member
 
Registered: Sep 2005
Location: Coimbatore
Distribution: Prabuayyappan
Posts: 32

Rep: Reputation: 15
You can exceute the following commands which will add static route to the routing table,
route add -net 192.168.77.0/24 gw 192.168.1.72 dev ppp0
route add -net 192.168.78.0/24 gw 192.168.1.72 dev ppp0

This routing is only stored in the memory, but once you reboot the system or restart the network service, it will not be there. So you can add those line to /etc/rc.d/rc.local which enable static routing at ths system startup
 
Old 11-23-2005, 05:07 AM   #5
rubella
Member
 
Registered: Sep 2005
Location: Europe
Distribution: debian sarge
Posts: 65

Original Poster
Rep: Reputation: 15
damn, i only have rc0.d -> rc6.d and a rcS.d folder...

no rc.d with a rc.local inside... where do i put the commands? thx!
 
Old 11-23-2005, 06:10 AM   #6
rubella
Member
 
Registered: Sep 2005
Location: Europe
Distribution: debian sarge
Posts: 65

Original Poster
Rep: Reputation: 15
hey guys, i've found the solution, thx to our network admin!

cause it's a pptp connection, it has a timeout... everytime the connection times out, it looses the routes...

how did i fix this?

in /etc/ppp/ip-up.d/ added i a file (chmod to executable) routes with following content:

#!/bin/bash
#sleep, because it first need to establish the pptp connection, otherwise he will loose routes immediatly
sleep 10
ip r a 192.168.77.0/24 via 192.168.1.72
ip r a 192.168.78.0/24 via 192.168.1.72

in /etc/ppp/ip-down.d/ added i a file (chmod to executable) routes with following content:

#!/bin/bash
ip r d 192.168.77.0/24
ip r d 192.168.78.0/24


So, first file add routes when i make a pptp connection, second file delete routes when i disconnect...

hope this is helpfull to someone, thx for comments!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Routes Obie Linux - Networking 16 04-28-2005 10:15 PM
Installation routes drcyber Linux - Newbie 4 09-02-2004 10:40 AM
routes himyuza *BSD 6 08-03-2004 10:41 AM
I need some routes |Drakehash| Linux - Newbie 1 06-08-2003 12:22 AM
I need some routes |Drakehash| Linux - Networking 1 06-07-2003 02:36 PM


All times are GMT -5. The time now is 08:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration