LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-09-2009, 10:51 AM   #1
UltraSoul
Member
 
Registered: Dec 2004
Location: Japan
Distribution: REDHAT9.0, Mandrake10.1
Posts: 404

Rep: Reputation: 31
how to add static route for loopback interface.


HI, All

I have configured LVS under RHEL5.

I need to configure static route to my VIP.
Now, I used the following command to add route but reboot OS will flush the route.

# route add -host 192.168.11.55 dev lo:0


google always told me how to add static route for certain network via
/etc/sysconfig/network-scripts/route-<device-name>. But I did not found
that for host.

Kindly pls advise.

Thank you
 
Old 04-10-2009, 03:55 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well you do need to use that file, yes. if you want to add a machine for a single host just use a 32 bit netmask.
 
Old 04-11-2009, 09:30 PM   #3
UltraSoul
Member
 
Registered: Dec 2004
Location: Japan
Distribution: REDHAT9.0, Mandrake10.1
Posts: 404

Original Poster
Rep: Reputation: 31
Hi, I created the following route-lo:0 file but the static route for lo:0 is not added to route table.

ADDRESS0=192.168.11.55
NETMASK0=255.255.255.255
GATEWAY0=127.0.0.1
 
Old 04-12-2009, 12:38 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,230

Rep: Reputation: 132Reputation: 132
# route add -host 192.168.11.55/mask dev lo:0 add this command on rc.local,
actually this is a way to execute commands on system boot
 
Old 04-12-2009, 01:02 AM   #5
UltraSoul
Member
 
Registered: Dec 2004
Location: Japan
Distribution: REDHAT9.0, Mandrake10.1
Posts: 404

Original Poster
Rep: Reputation: 31
thank u, the problem is fixed by adding command at /etc/rc.local
 
  


Reply


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
permanently add static route glock19 Linux - Networking 26 04-08-2013 04:07 AM
How to add a multicast static route in centOS4.4 dozer Linux - Networking 2 08-05-2011 03:09 PM
DHCP default route attached to loopback interface chiefdan Linux - Hardware 2 12-06-2005 05:08 PM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
add a static route in Network init files Ghitza Linux - Networking 1 11-19-2004 05:26 AM


All times are GMT -5. The time now is 05:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration