<?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 Re: redhat linux - static route in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428150#M86545</link>
    <description>sorry.This is the entry in the /etc/sysconfig/static-route file.&lt;BR /&gt;&lt;BR /&gt;eth0 net 224.0.0.0 netmask 255.0.0.0&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;mB</description>
    <pubDate>Tue, 23 Nov 2004 00:14:05 GMT</pubDate>
    <dc:creator>malay boy</dc:creator>
    <dc:date>2004-11-23T00:14:05Z</dc:date>
    <item>
      <title>redhat linux - static route</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428149#M86544</link>
      <description>Hi ,&lt;BR /&gt;   I need to put a static route.I have edited the file /etc/sysconfig/static-route with below line :&lt;BR /&gt;&lt;BR /&gt;eth0 net 224.0.0.0 subnet 255.0.0.0&lt;BR /&gt;&lt;BR /&gt;but no avail.The netstat -rn entry missing everything it's reboot.&lt;BR /&gt;&lt;BR /&gt;Linux Version = redhat &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any hint.&lt;BR /&gt;&lt;BR /&gt;regard&lt;BR /&gt;mB</description>
      <pubDate>Mon, 22 Nov 2004 23:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428149#M86544</guid>
      <dc:creator>malay boy</dc:creator>
      <dc:date>2004-11-22T23:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: redhat linux - static route</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428150#M86545</link>
      <description>sorry.This is the entry in the /etc/sysconfig/static-route file.&lt;BR /&gt;&lt;BR /&gt;eth0 net 224.0.0.0 netmask 255.0.0.0&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;mB</description>
      <pubDate>Tue, 23 Nov 2004 00:14:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428150#M86545</guid>
      <dc:creator>malay boy</dc:creator>
      <dc:date>2004-11-23T00:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: redhat linux - static route</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428151#M86546</link>
      <description>Depending on your RH version file name should be either&lt;BR /&gt;&lt;BR /&gt;/etc/sysconfig/static-routes&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;/etc/sysconfig/network-scripts/route-&lt;INTERFACE-NAME&gt;&lt;BR /&gt;&lt;BR /&gt;Read /usr/share/doc/initscript*/sysconfig.txt to see which one to use.&lt;/INTERFACE-NAME&gt;</description>
      <pubDate>Tue, 23 Nov 2004 00:28:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428151#M86546</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2004-11-23T00:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: redhat linux - static route</title>
      <link>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428152#M86547</link>
      <description>Dear mB,&lt;BR /&gt;&lt;BR /&gt;        With the introduction of Redhat version 8 and continued into version 9, the /etc/sysconfig/static-routes file no longer seems to function correctly.&lt;BR /&gt;&lt;BR /&gt;Linux static routes changed in 8.0 to a new format. Now you are to create a file in /etc/sysconfig/network-scripts for each Ethernet interface you wish to create static routes on.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;touch /etc/sysconfig/network-scripts/route-eth0&lt;BR /&gt;&lt;BR /&gt;The syntax for this file is different from the traditional route format used in /etc/sysconfig/static-routes . Redhat has yet to document the change on their web site as of June 2003.&lt;BR /&gt;&lt;BR /&gt;Syntax based on a usenet post go to /etc/sysconfig/network-scripts, make a file called route-devicename (ex: route-eth0) and populate it with your static routes for that device so if you wanted to make a static route to the 192.168.0.0/24 network through 152.3.182.5 type:&lt;BR /&gt;&lt;BR /&gt;192.168.0.0/24 via 152.3.182.5&lt;BR /&gt;&lt;BR /&gt;Persistent static routes for ANY linux distribution&lt;BR /&gt;&lt;BR /&gt;You may use this method to add static routes and it will work under any Linux distribution. However, it is considered by some a 'hack' or the 'ugly way'.&lt;BR /&gt;&lt;BR /&gt;Edit your /etc/rc.local file and add your static routes using the route statement.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;route add -net 10.10.98.0 netmask 255.255.255.0 gw 10.164.234.132 dev eth1&lt;BR /&gt;route add -net 10.164.234.96 netmask 255.255.255.252 gw 10.164.234.132 dev eth1&lt;BR /&gt;route add -net 10.164.234.112 netmask 255.255.255.240 gw 10.164.234.132 dev eth1&lt;BR /&gt;&lt;BR /&gt;Force the old static-routes file to work under Redhat 9&lt;BR /&gt;&lt;BR /&gt;Clear out the new /etc/sysconfig/network-scripts/ifup-routes script so that you can populate it with the original shell script from Redhat 7.x.&lt;BR /&gt;&lt;BR /&gt;cat /dev/null &amp;gt; /etc/sysconfig/network-scripts/ifup-routes&lt;BR /&gt;vi /etc/sysconfig/network-scripts/ifup-routes&lt;BR /&gt;&lt;BR /&gt;type in the following (or copy and paste) not including the tilde lines:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;# adds static routes which go through device $1&lt;BR /&gt;&lt;BR /&gt;if [ "$1" = "" ]; then&lt;BR /&gt;  echo "usage: $0 &lt;NET-DEVICE&gt;"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ ! -f /etc/sysconfig/static-routes ]; then&lt;BR /&gt;  exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# note the trailing space in the grep gets rid of aliases&lt;BR /&gt;grep "^$1 " /etc/sysconfig/static-routes | while read device args; do&lt;BR /&gt;  /sbin/route add -$args $device&lt;BR /&gt;done&lt;BR /&gt;grep "^any " /etc/sysconfig/static-routes | while read ignore type net netmask mask bogus dev ; do&lt;BR /&gt;  if [ "$dev" = "$1" ]; then&lt;BR /&gt;    /sbin/route add -$type $net $netmask $mask $dev&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Remember to use /etc/sysconfig/network for your default gateway&lt;BR /&gt;&lt;BR /&gt;If you only intend to add one route, your default gateway, then you need not worry about the static routes file or using the route command. Simply add your default gateway in /etc/sysconfig/network.&lt;BR /&gt;&lt;BR /&gt;Example&lt;BR /&gt;&lt;BR /&gt;NETWORKING=yes&lt;BR /&gt;HOSTNAME="hostname.linux.org"&lt;BR /&gt;GATEWAY="10.164.234.1"&lt;BR /&gt;GATEWAYDEV="eth0"&lt;BR /&gt;FORWARD_IPV4="yes"&lt;BR /&gt; &lt;BR /&gt;Regards,&lt;BR /&gt;Syam&lt;/NET-DEVICE&gt;</description>
      <pubDate>Tue, 23 Nov 2004 00:54:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/redhat-linux-static-route/m-p/3428152#M86547</guid>
      <dc:creator>Ranjith_5</dc:creator>
      <dc:date>2004-11-23T00:54:09Z</dc:date>
    </item>
  </channel>
</rss>

