LinuxQuestions.org
Review your favorite Linux distribution.
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


Closed Thread
  Search this Thread
Old 04-27-2006, 10:39 AM   #1
ANU
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Solaris 10
Posts: 78

Rep: Reputation: 15
Question persistent static route


what is the best, most reliable way in a solaris/unix to do a persistent or static route?
I need the system to remember this route after reboot.

route add -net x.x.x.x netmask 255.255.255.x gw x.x.x.x metric 1


For example, is there a file that I can simply put this in like in RH there was /etc/sysconfig/static-routes
i know that i can also write a script and put it in the rc.d dir so it runs after booting... are there some other way?
 
Old 04-27-2006, 11:19 AM   #2
whysyn
Member
 
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154

Rep: Reputation: 30
Some *nix's have a conf file to set these in, but it usually is a shell-script kludge... ymmv. The one in RH is just a shell script that runs the route command with your arguments.

Personally, I think it's best to just put the route command into your "local" init scripts. (/etc/init.d/rc.local on Linux). You shouldn't have to write your whole own init script, there should already be a "local" file for running simple commands at boot time.

EDIT: clarification

Last edited by whysyn; 04-27-2006 at 11:21 AM.
 
Old 04-27-2006, 11:51 AM   #3
ANU
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Solaris 10
Posts: 78

Original Poster
Rep: Reputation: 15
Question

thanks for your answer whysyn
i know its no big deal to write the commands in a files and put it in rc.d dir
im interested if there is some other way beside this one.
I would use a config file like /etc/sysconfig/static-routes but i dont know to exist one in Solaris 10 or maybe another program that does this static route stuff
 
Old 04-27-2006, 12:17 PM   #4
whysyn
Member
 
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154

Rep: Reputation: 30
Sorry, I guess I read into your question incorrectly... =)

I don't know Solaris much myself, but I do know that the last SCO box I admined had to just have persistent routes in init scripts manually. If there is a more elegant solution on Solaris I don't know it.

The /etc/sysconfig/static-routes file in RedHat is used by a relatively simple shell script. If you have ten minutes and feel like tinkering a bit I imagine you could use the RH scripts on your Solaris box. If you want to try to adapt them but don't have access to a RH box any longer I'd be glad to link them up for you.

Good luck!
 
Old 02-22-2012, 06:13 AM   #5
ehowstuff
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
Steps Change The Default Route or Gateway on Solaris :
1. Edit /etc/defaultrouter
-This configuration will apply after next reboot.

[root@SolarisServer ~]# vi /etc/defaultrouter
192.168.2.1

Proceed to change the ip to your preferred/new ip address of your gateway and save.

2. Run the following command to delete and add the default route.
-This will apply the configuration with immediate effect. Assume that the existing gateway 192.168.1.1 will be change to 172.19.1.1.

[root@SolarisServer ~]# route delete default 172.19.1.1
[root@SolarisServer ~]# route add default 172.19.1.1

How to Change The Default Route or Gateway on Solaris
 
1 members found this post helpful.
Old 04-01-2012, 07:23 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Please don't resurrect ancient threads. The original poster most likely won't notice it to benefit. Also, it seems you posted this merely to spam your website (SEO). Please remove the advertisement from your signature.
 
  


Closed Thread

Tags
route, static


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
static route dvong3 Linux - Networking 1 01-25-2006 04:42 PM
Help with static route noinfo Linux - Networking 1 10-05-2005 11:40 AM
static route cox Linux - Networking 3 09-30-2003 02:22 PM
Make a ROUTE persistent accross boots of the system thecrab Linux - Networking 2 05-30-2002 02:51 PM
Adding persistent(permanent) route entries on Red hat Linux 7.1 sram Linux - Networking 1 02-08-2002 10:07 AM

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

All times are GMT -5. The time now is 09:05 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