Networking

ID #1066

Howto make static route(s) permanent

Problem

If I use the command "route add -net x.y.z.t netmask a.b.c.d ... ethx",
the route is added only until next reboot. :-(

Is there a way ( via setup or other ) to add PERMANENTLY a route ?


Solution

Add the 'route' command to the /rc/rc_user script.


For FREESCO 027 this script has a start and a stop section, see comments:

CODE
echo -n "Starting rc_user... "
# Add commands here you want to execute when booting. Use the fork
# command to launch programs which normally stay in the foreground.
route add -net x.y.z.t netmask a.b.c.d ... ethx


CODE
echo -n "Stopping rc_user... "
# Add commands here you want to execute when shutting down or rebooting.
# Be careful not to use any commands which wait for user input.
route del x.y.z.t


For FREESCO 03x, the script has a switch statement, with clearly indicated start) and stop) sections:

CODE
start) echo -n "Starting rc_user... "
# Add commands here you want to execute when starting
# the router.
# Use the fork command to launch programs which normally stay
# in the foreground.
# This part is called after all rc_* files.
route add -net x.y.z.t netmask a.b.c.d ... ethx=
;;

stop) echo -n "Stopping rc_user... "
# Add commands here you want to execute when restarting,
# shutting down or rebooting.
# Be careful not to use any commands which wait for user input.
# This part is called before all rc_* files.
route del x.y.z.t=
;;



Add you command(s) before the equal sign (=) and make sure to leave the double semi colons (;;) in place!



Always use a linux compatible editor (like edit, joe, vi, teddy, mc, etc.) to make changes, never a DOS/Windoze editor, since a DOS/Windoze editor will add ^M characters (CARRIAGE RETURN) at the end of each line, making the script unusable!

Last update: 2006-05-10 10:42
Author: Dingetje
Revision: 1.0

change language
 

Print this record Print this record
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
Export as XML-File Export as XML-File

Please rate this entry:

Average rating: 3.75 from 5 (4 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry

Comment of kimi (2008-03-14 03:46:27):
推荐一家专业的翻译公司在上海,这家上海翻译公司提供多种翻译服务:论文翻译(包括专业、严谨的会议论文翻译,毕业论文翻译,发表论文翻译及教学案例翻译等)、图书翻译(包括出版级的图书、教材翻译,学术专著翻译和名著翻译等)、同声传译(包括会议口译、交替传译、同声传译、陪同翻译等服务)、资料精译(包括各种商务、科技类技术资料精译,科技成果翻译,专利翻译,招股说明书和公文翻译等),上海翻译公司还提供其他的诸如文书撰写(专业的外文商业计划书、商务推广书、市场调查报告、管理咨询报告、财务分析报告、审计报告等商务文书的翻译,同时提供外文法律文书、出国留学/移民文书的撰写翻译服务)以及其他行业翻译、特色翻译等,总共囊括50多个语种的精心翻译。 另外,上海翻译公司旗下的妙文上海会展公司还提供多种会展服务如展台设计、展台搭建等。 其次还有会议服务网,以专业服务和职业精神为客户提供科学高效的会议服务。翻译公司给您满意服务。