Operating System - HP-UX
1833697 Members
3395 Online
110062 Solutions
New Discussion

Re: Routing to secondary loopback interface

 
SOLVED
Go to solution
Mihails Nikitins
Super Advisor

Routing to secondary loopback interface

Hi,

I'm trying to implement a simple HA solution.

The server may have multiple LAN cards. Application listens to secondary loopback interface that is always up. If the router receives a packet for application address, it should send it to an available LAN card of the server.

LAN cards and secondary loopback belongs to different networks, so there is no problems with routing in the network environment.

ifconfig lo0:1 192.168.1.1 netmask 255.255.255.0 up
ifconfig lan0 192.168.2.1 netmask 255.255.255.0 up
ifconfig lan1 192.168.3.1 netmask 255.255.255.0 up

E.g., the router should send packets to 192.168.2.1 or to 192.168.3.1 if destination address 192.168.1.1.

However, there is no answer from secondary loopback. Routing in the network is working fine. Secondary loopback address is available locally. I tried the solution with only one LAN card configured.

Switching ip forwarding on also does not help
ndd -set /dev/ip ip_forwarding 1

Is it possible to make it work?
Thanks in advance for any comments!

BR,
Mihails Nikitin
KISS - Keep It Simple Stupid
6 REPLIES 6
sven verhaegen
Respected Contributor

Re: Routing to secondary loopback interface

Hello

I???m not sure if you work in a serviceguard environment but I???ve seen something in your comments

ifconfig lo0:1 192.168.1.1 netmask 255.255.255.0 up
ifconfig lan0 192.168.2.1 netmask 255.255.255.0 up
ifconfig lan1 192.168.3.1 netmask 255.255.255.0 up

you are talking about putting a IP on lo0:1 , you might be able to do so but I never tried it and probably putting an IP on there will either fail during boot (your comment suggest it does work however) with a skint message in rc.log but not fail the machine or it will put the IP up and be pingable but the IP stack of the HP machine could get confused not being aware of multiple IP on loopback interfaces and be unable to route back between several internal interfaces , putting up a second IP on the loopback isn???t a good idea in my opinion.

As far as I can see you just want the application to link to one IP but be reachable by multiple subnets over several interfaces , this is what happens when using MC/ServiceGuard software , where you can put up packages and give them a specific package IP , the methode you are applying now most probably fails because of the internal stack of the HP not knowing very well how to internally route on this dual addressed loopback and selects just not to forward anything or is unable to send any reply back .

Also you mentioned that switching ip forwarding on also does not help

ndd -set /dev/ip ip_forwarding 1

Why doesn???t it work , because it normally is already activated on any HP_UX system , the forwarding rules does apply to communication over the several interfaces but internal routing on the system with loopback and interfaces doesn???t fully follow this (don???t ask details because I don???t have them , this is from experience with internel system routing) , e.g when for instance disabling ip-forwarding on a system , one can still ping from interface A on this system to it???s interface B with another subnet???..
This is strange but it proves internal routing and external interface routing are 2 different things .

As far as I can grasp what you are trying to do I still think MC/ServiceGuard comes closest to what you really want to implement???please refer to the HP website for information on this product


...knowing one ignores a greath many things is the first step to wisdom...
Mihails Nikitins
Super Advisor

Re: Routing to secondary loopback interface

Thanks for your reply, Sven!

This play with loopback addresses works in some other Unicies (e.g. Free BSD and Solaris). It's possible to change even primary loopback address from 127.0.0.1 , and I know about some 'cheap-and-dirty' HA solutions using this technique. I know about MC/ServiceGuard, but it's commercial software.

It looks like HP-UX does not allow such tricks.

BR,
Mihails Nikitins

KISS - Keep It Simple Stupid
Dmitry G. Spitsyn
Trusted Contributor
Solution

Re: Routing to secondary loopback interface

It does Mihails, but starting from HP-UX 11i !
What version of HP-UX are you have?
BR,
Dmitry
James R. Ferguson
Acclaimed Contributor

Re: Routing to secondary loopback interface

Hi:

If you haven't already, you might want to look at the APA (auto-port aggregation) product:

http://www.hp.com/products1/unixserverconnectivity/software/info_library.html

Regards!

...JRF...
Mihails Nikitins
Super Advisor

Re: Routing to secondary loopback interface

Thank you, Dmitry! I tested this solution on HP-UX 11.0, but I will try to test it also on 11i when possible.

Thank you, James! You mean a good product, but (IMHO) it works only if all NICs are connected to the same switch. We get LAN card and link redundancy, but the switch itself will remain single point of failure.

BR,
Mihails
KISS - Keep It Simple Stupid
Wayne Yu_1
Frequent Advisor

Re: Routing to secondary loopback interface

I am interested in finding the answers for this question as well. The URL in the reply seems no longer there. Could someone publish the finding on this? Thanks.