Operating System - HP-UX
1826703 Members
2517 Online
109696 Solutions
New Discussion

How to configure static route to individual LAN port

 
SOLVED
Go to solution
Chew Kok Seng
New Member

How to configure static route to individual LAN port

Hi,

Say I have 3 ip addresses:
172.16.9.60 on lan1
172.16.9.61 on lan2
172.16.9.62 on lan0
using a single gateway 172.16.9.1

My applications need to be routed such a way that application 1 uses only lan1, application 2 uses on lan2 and lan0 is use as management lan.

If I configure default routing on lan0 to the gateway, I see all my traffic being routed via Lan0 only. lan1 and lan2 are not used.

How can I configure such that the ip traffic destined for the ip addresses of lan1 and lan2 to use its on port and not using the default route/gateway?
7 REPLIES 7
Ivan Krastev
Honored Contributor

Re: How to configure static route to individual LAN port

Configure it in netconf - see this thread http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=998591

regards,
ivan
Chew Kok Seng
New Member

Re: How to configure static route to individual LAN port

the thread showed ip addresses on different subnets:
Head office Router.. 89.0.3.249
Router at DR Site... 89.0.2.249

But I have all addresses in the same subnet.
If I have to route message from:
172.16.9.60 to 172.16.9.12 for application 1
172.16.9.61 to 172.16.9.12 for application 2
Nothing to be sent via 172.16.9.62.

Will configuring net work for this case?
Matti_Kurkela
Honored Contributor
Solution

Re: How to configure static route to individual LAN port

It is very difficult to make this kind of configuration to work as you require.

Please see this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=616802

You'll need to have the applications bind to their specific IP addresses, and enable the "Strong ES model" function:
ndd -set /dev/tcp ip_strong_es_model 1

According to HP-UX LAN Administrator's Guide, you should not enable two network interfaces of the same host into the same network segment at the same time.
http://docs.hp.com/en/B2355-90796/ch04s02.html
So, you're attempting an unsupported configuration and problems are likely.

By using the optional APA software, you can make several interfaces work like a single, higher-capacity interface and thus work around this problem somewhat. But it seems to me APA would not help you, as your needs are more complex than that.
MK
Chew Kok Seng
New Member

Re: How to configure static route to individual LAN port

Ok, now if I split the IP address to the two subnets
172.16.9.0/25 gw 172.16.6.1
172.16.9.128/25 gw 172.16.6.129

using ip address:
172.16.6.61
172.16.6.200

Can I do this?

ROUTE_DESTINATION[1]="net 172.16.9.0"
ROUTE_MASK[1]=255.255.0.0
ROUTE_GATEWAY[1]=122.16.9.1
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""


ROUTE_DESTINATION[2]="net 172.16.9.128"
ROUTE_MASK[2]=255.255.0.0
ROUTE_GATEWAY[2]=172.16.9.129
ROUTE_COUNT[2]=1
ROUTE_ARGS[2]=""

With this allow the right messages to go to the right lan port?
Matti_Kurkela
Honored Contributor

Re: How to configure static route to individual LAN port

That looks do-able, but at least one of your ROUTE_MASKs should be /25 (i.e. 255.255.255.128) too.

Routing decisions are made using binary AND operations as follows:

if ( AND ) = ( AND )
then send to

The routing table is automatically arranged so that the most specific routes are tested first. If nothing else matches, we get to the default route: it has a mask of 0.0.0.0, which means it will always match.

If you don't change your ROUTE_MASKs, your two route definitions will both match to all packets going to 172.16.*.*, which is not what you want.


ROUTE_DESTINATION[1]="net 172.16.9.0"
ROUTE_MASK[1]=255.255.0.0
ROUTE_GATEWAY[1]=172.16.9.1 #typo fixed?
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""


ROUTE_DESTINATION[2]="net 172.16.9.128"
ROUTE_MASK[2]=255.255.255.128 # changed
ROUTE_GATEWAY[2]=172.16.9.129
ROUTE_COUNT[2]=1
ROUTE_ARGS[2]=""

If your default route still goes to 172.16.9.1, the first group is redundant.
The second group is the essential one to make the new subnet work.
MK
Chew Kok Seng
New Member

Re: How to configure static route to individual LAN port

Cool, it worked. thanks alot for the pointers.
Chew Kok Seng
New Member

Re: How to configure static route to individual LAN port

A solution and explanation was found.