The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
permanently change KDE DPI raidzero Slackware 1 09-03-2008 11:27 AM
Static Route Arun.Kakarla UNIX for Dummies Questions & Answers 2 07-17-2008 09:07 AM
dhcpd.conf - static route prvnrk Linux 3 08-14-2007 10:23 AM
Static route for hpux 11.22 catwomen HP-UX 2 10-10-2006 09:55 AM
static route ? chaandana IP Networking 3 07-05-2005 03:05 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-16-2009
beaker457 beaker457 is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 8
permanently add static route

I have a machine with an interface that has two different addresses on CentOS 5

eth0: 10.20.21.77
eth0:1 141.218.1.221

If I issue this command I get the result I'm looking for.
/sbin/route add -net 141.218.1.0 netmask 255.255.255.0 gw 10.20.21.77

ip route show dev eth0
141.218.1.0/24 via 10.20.21.77 scope link
141.218.1.0/24 proto kernel scope link src 141.218.1.221
10.20.21.0/24 proto kernel scope link src 10.20.21.221
169.254.0.0/16 scope link
default via 10.20.21.1

Now I reboot the machine and the route goes away, I've tried creating a file in /etc/sysconfig/network-scripts/route-eth0 that contains
141.218.1.0/24 via 10.20.21.77

Also tried:
141.218.1.0/24 via 10.20.21.77 dev eth0


On a reboot it looks like this...
ip route show dev eth0
141.218.1.0/24 proto kernel scope link src 141.218.1.221
10.20.21.0/24 proto kernel scope link src 10.20.21.77
169.254.0.0/16 scope link
default via 10.20.21.1

Running ifup-routes by hand results with:
./ifup-routes eth0
RTNETLINK answers: File exists



Thanks for any help.

Last edited by beaker457; 04-16-2009 at 11:52 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0