<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic add static routes at startup .. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572462#M30745</link>
    <description>Hello&lt;BR /&gt;    Does anyone have a script would add static routes at startup. I know how to enable it but I dont know how to write a config file. My understanding is that I need a config file in rc.config.d  to add a script to add routes on startup. Does anyone have a config file or suggestions?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
    <pubDate>Wed, 29 Aug 2001 21:13:53 GMT</pubDate>
    <dc:creator>someone_4</dc:creator>
    <dc:date>2001-08-29T21:13:53Z</dc:date>
    <item>
      <title>add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572462#M30745</link>
      <description>Hello&lt;BR /&gt;    Does anyone have a script would add static routes at startup. I know how to enable it but I dont know how to write a config file. My understanding is that I need a config file in rc.config.d  to add a script to add routes on startup. Does anyone have a config file or suggestions?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Wed, 29 Aug 2001 21:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572462#M30745</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-08-29T21:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572463#M30746</link>
      <description>I don't have a script written, but if you take a look at /sbin/init.d/net (a link from /sbin/rc2.d/S900net to it as well), you should be able to use that as a template for entering the route commands you need. Don't enter them directly into that script though, as it gets overwritten during upgrades and some patches.  You could just copy the script to say net2 and make some modifications.  I would suggest cleaning out the redundant entries in it as apposed to the net script.</description>
      <pubDate>Wed, 29 Aug 2001 21:41:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572463#M30746</guid>
      <dc:creator>Angus Crome</dc:creator>
      <dc:date>2001-08-29T21:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572464#M30747</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;If you are going to use the IP of one of the interfaces for routing, then you can use the default /etc/rc.cofnig.d/netconf file itself.&lt;BR /&gt;&lt;BR /&gt;Otherwise, you need to write a small script and put it under /sbin/init.d with proper links in /sbin/rc3.d file.&lt;BR /&gt;&lt;BR /&gt;You also may want to create a control file in /etc/rc.config.d where you would define a variable that will be checked by the script in /sbin/init.d directory.&lt;BR /&gt;&lt;BR /&gt;Following is the skeleton of the script. You can customize it according to your needs.&lt;BR /&gt;&lt;BR /&gt;/etc/rc.config.d/statroute:&lt;BR /&gt;&lt;BR /&gt;#Your comments&lt;BR /&gt;STATICROUTE=1&lt;BR /&gt;&lt;BR /&gt;/etc/sbin/init.d/statroute:&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;#Your comments&lt;BR /&gt;&lt;BR /&gt;PATH=$PATH:Your_additional_paths&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;if [ -r /etc/rc.config.d/statroute ]&lt;BR /&gt;then&lt;BR /&gt;. /etc/rc.config.d/statroute&lt;BR /&gt;else&lt;BR /&gt;echo "/etc/rc.config.d/statroute file missing"&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt;&lt;BR /&gt;      start_msg) &lt;BR /&gt;      print "Adding the static routes"&lt;BR /&gt;      exit 0&lt;BR /&gt;      ;;&lt;BR /&gt;      start)&lt;BR /&gt;      route add net your_destination your_ip&lt;BR /&gt;      if [ $? != 0 ]&lt;BR /&gt;      then&lt;BR /&gt;      echo "Failed to add static route"&lt;BR /&gt;      exit 1&lt;BR /&gt;      fi&lt;BR /&gt;      *) &lt;BR /&gt;      print "Improper arguments to the script"&lt;BR /&gt;      exit 1&lt;BR /&gt; esac&lt;BR /&gt;     &lt;BR /&gt;//End of File//&lt;BR /&gt;&lt;BR /&gt;#ln -s /sbin/init.d/statroute /etc/rc.config.d/rc3.d/S9xxstatroute&lt;BR /&gt;&lt;BR /&gt;We are not interested in stop sequence.&lt;BR /&gt;&lt;BR /&gt;You need to check the syntax of the above script and add if you need anything.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2001 22:07:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572464#M30747</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-29T22:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572465#M30748</link>
      <description>oops.. missed a small thing..We didnt' check for rc.config.d file.&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;start)&lt;BR /&gt;&lt;BR /&gt;if [ $STATICROUTE = 1 ]&lt;BR /&gt;then&lt;BR /&gt;route add net your_destination your_ip &lt;BR /&gt;if [ $? != 0 ] &lt;BR /&gt;then &lt;BR /&gt;echo "Failed to add static route" &lt;BR /&gt;exit 1 &lt;BR /&gt;fi &lt;BR /&gt;else&lt;BR /&gt;exit 2&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;....</description>
      <pubDate>Wed, 29 Aug 2001 22:14:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572465#M30748</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-29T22:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572466#M30749</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;The easiest thing to do is to modify the /etc/rc.config.d/netconf. You could do something like this&lt;BR /&gt;&lt;BR /&gt;ROUTE_DESTINATION[0]=default&lt;BR /&gt;ROUTE_MASK[0]=""&lt;BR /&gt;ROUTE_GATEWAY[0]=xxx.xxx.xxx.254&lt;BR /&gt;ROUTE_COUNT[0]=1&lt;BR /&gt;ROUTE_ARGS[0]=""&lt;BR /&gt;&lt;BR /&gt;ROUTE_DESTINATION[1]="net yyy.yyy.yyy"&lt;BR /&gt;ROUTE_MASK[1]=""&lt;BR /&gt;ROUTE_GATEWAY[1]=xxx.xxx.xxx.zz&lt;BR /&gt;ROUTE_COUNT[1]=1&lt;BR /&gt;ROUTE_ARGS[1]=""&lt;BR /&gt;Here xxx.xxx.xxx.254 is your default gateway&lt;BR /&gt;yyy.yyy.yyy is the network you want to setup a static route to&lt;BR /&gt;xxx.xxx.xxx.zz is the IP address you want to use to connect to the network yyy.yyy.yyy&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Wed, 29 Aug 2001 23:01:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572466#M30749</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-29T23:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572467#M30750</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;I wrote a script for you (I took the template in /sbin/init.d and modified it). You just have to change the static_route configuration file to be placed in /etc/rc.config.d.&lt;BR /&gt;&lt;BR /&gt;Once you copy the scripts, make sure you create the links in /sbin/rc2.d for startup and shutdown&lt;BR /&gt;&lt;BR /&gt;-Regards&lt;BR /&gt;Ramesh</description>
      <pubDate>Thu, 30 Aug 2001 00:01:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572467#M30750</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-30T00:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572468#M30751</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;For defining route on startup, you better configure your /etc/rc.config.d/netconf :&lt;BR /&gt;&lt;BR /&gt;Entry :&lt;BR /&gt;&lt;BR /&gt;ROUTE_GATEWAY[x]=ip&lt;BR /&gt;&lt;BR /&gt;x : Is the instance number ( start at zero and for other instances you can increment one, two etc...)&lt;BR /&gt;ip : IP address for the default route gateway.&lt;BR /&gt;&lt;BR /&gt;Magdi</description>
      <pubDate>Thu, 30 Aug 2001 05:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572468#M30751</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-08-30T05:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: add static routes at startup ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572469#M30752</link>
      <description>Hi again Richard,&lt;BR /&gt;&lt;BR /&gt;Of course, the following :&lt;BR /&gt;&lt;BR /&gt;ROUTE_DESTINATION[x]=default &lt;BR /&gt;ROUTE_MASK[x]="" &lt;BR /&gt;ROUTE_COUNT[x]=1 &lt;BR /&gt;ROUTE_ARGS[x]="" &lt;BR /&gt;&lt;BR /&gt;and for other gateway :&lt;BR /&gt;ROUTE_GATEWAY[y]=address1&lt;BR /&gt;ROUTE_DESTINATION[y]=address2&lt;BR /&gt;ROUTE_MASK[y]="" &lt;BR /&gt;ROUTE_COUNT[y]=1 &lt;BR /&gt;ROUTE_ARGS[y]="" &lt;BR /&gt;&lt;BR /&gt;Magdi</description>
      <pubDate>Thu, 30 Aug 2001 05:45:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/add-static-routes-at-startup/m-p/2572469#M30752</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-08-30T05:45:56Z</dc:date>
    </item>
  </channel>
</rss>

