LinuxQuestions.org
Visit Jeremy's Blog.
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-01-2010, 08:39 PM   #1
computerman1983
LQ Newbie
 
Registered: Aug 2009
Distribution: Ubuntu 9.10, Red Hat WS 4, CentOS, OpenBSD, and all windows flavs
Posts: 20

Rep: Reputation: 1
Routes not persistent


Hello,

I have a ubuntu 10.04.1 install with openvpn, so I have some routes in my /etc/networking/interface file. But for what ever reason when it boots the routes don't come up and I have to restart the networking before they come up. Once I do that all is well. Any idea's why it's doing that?

Thanks!
 
Old 09-02-2010, 03:32 PM   #2
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Routes in your interfaces file, I don't think so, unless they are default routes for each interface. You really need a script to set them up.
 
Old 09-02-2010, 04:46 PM   #3
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
The routes are for which interfaces, standard ethernet or the openvpn tap/tun interface?

scheidel21, of course you can that's what the whole up thing is for in interfaces, you can use it to run any arbitrary thing you want conditioned on the interface coming up or down as the case may be.

excerpt from man interfaces
Quote:
pre-up command
Run command before bringing the interface up. If this command fails then ifup aborts, refraining from marking the
interface as configured, prints an error message, and exits with status 0. This behavior may change in the future.

up command

post-up command
Run command after bringing the interface up. If this command fails then ifup aborts, refraining from marking the inter-
face as configured (even though it has really been configured), prints an error message, and exits with status 0. This
behavior may change in the future.

down command

pre-down command
Run command before taking the interface down. If this command fails then ifdown aborts, marks the interface as decon-
figured (even though it has not really been deconfigured), and exits with status 0. This behavior may change in the
future.

post-down command
Run command after taking the interface down. If this command fails then ifdown aborts, marks the interface as deconfig-
ured, and exits with status 0. This behavior may change in the future.

Last edited by estabroo; 09-02-2010 at 04:47 PM. Reason: added smal excerpt from man interfaces
 
Old 09-03-2010, 08:55 AM   #4
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
I forgot all about the pre-up/down and up/down syntax for the interfaces file, I never had a need for them. That said perhaps he should make sure he is using this syntaxt and that he is using the post-up option.
 
Old 09-04-2010, 05:41 PM   #5
computerman1983
LQ Newbie
 
Registered: Aug 2009
Distribution: Ubuntu 9.10, Red Hat WS 4, CentOS, OpenBSD, and all windows flavs
Posts: 20

Original Poster
Rep: Reputation: 1
Thanks guys for the help. estabroo was right on just reading the man file. I added the up and down commands in my config and they come up as they should. I though I tried that at one point but I don't think ubuntu can handle 192.168.1.1/16, instead i had to give it the full netmask. IE 192.168.1.1 255.255.255.0.

Thanks guys!
 
  


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
Adding persistent static routes in Redhat.. [NISTnet installed...!] bala1987 Linux - Networking 2 05-26-2009 08:58 AM
Cannot add persistent routes janihemang Linux - Networking 2 08-05-2008 10:37 AM
Static routes using routes/ifroutes-eth-id.. files and default gateway disabled TimtheEagle Linux - Networking 0 05-31-2008 07:08 PM
persistent static routes, not so persistent Hewson Linux - Networking 4 04-27-2007 05:09 PM
Question about persistent routes in redhat 9 shrike wensbot Linux - Networking 5 06-03-2003 08:51 AM

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

All times are GMT -5. The time now is 12:13 AM.

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