LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to add static route for loopback interface. (http://www.linuxquestions.org/questions/linux-software-2/how-to-add-static-route-for-loopback-interface-717975/)

UltraSoul 04-09-2009 10:51 AM

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

acid_kewpie 04-10-2009 03:55 AM

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.

UltraSoul 04-11-2009 09:30 PM

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

kirukan 04-12-2009 12:38 AM

# 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

UltraSoul 04-12-2009 01:02 AM

thank u, the problem is fixed by adding command at /etc/rc.local


All times are GMT -5. The time now is 05:04 AM.