Operating System - HP-UX
1833323 Members
3116 Online
110051 Solutions
New Discussion

Configuring multiple Interfaces on HP-UX

 
SOLVED
Go to solution

Configuring multiple Interfaces on HP-UX

Hi,

I have servers which meed to be part of multiple networks. In fact my server needs to be part of 4 different subnets. I have managed to configure 3 interfaces correctly and route them properly using the route add command. routing the 4th interface is a total nightmare. I was wondering could anyone out there advice me if I can set default gateways for each interface by editing the netconf file. Also are these defualt gateways the equivalent of windows defualt gateways. In windows my understanding is that it is not advisable to configure defualt gateways for more than one interface. Is it the same for HP-UX as well.

TIA
Sid
23 REPLIES 23
Jakes Louw
Trusted Contributor

Re: Configuring multiple Interfaces on HP-UX

My understanding in a case like this is to use the server itself as a router: set up the default GW to be itself, then it builds it's own routing tables.
But then I'm not a networking guru...
Trying is the first step to failure - Homer Simpson
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Hi Sid,

You can configure your NICs with "sam". Its easy and efficient way too. No need to edit any files manually, sam will take care.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Yes you can.

You can set default gateway to separate network. How it will work is,

It will try to resolve with the allocated gateway else use default (*) gateway.

Can you post your,

# netstat -rnv

to help you out exactly.

--
Muthu
Easy to suggest when don't know about the problem!

Re: Configuring multiple Interfaces on HP-UX

DRXAP301:/# netstat -rnv
Routing tables
Dest/Netmask Gateway Flags Refs Interface Pmtu
127.0.0.1/255.255.255.255 127.0.0.1 UH 0 lo0 4136
10.154.231.21/255.255.255.255 10.154.231.21 UH 0 lan0 4136
10.154.230.21/255.255.255.255 10.154.230.21 UH 0 lan1 4136
10.54.230.54/255.255.255.255 10.54.230.54 UH 0 lan7 4136
10.154.231.0/255.255.255.0 10.154.231.21 U 2 lan0 1500
10.154.230.0/255.255.255.0 10.154.230.21 U 2 lan1 1500
10.54.230.0/255.255.255.0 10.54.230.54 U 2 lan7 1500
192.168.0.0/255.255.255.0 10.154.231.253 UG 0 lan0 0
127.0.0.0/255.0.0.0 127.0.0.1 U 0 lo0 0
default/0.0.0.0 10.154.230.253 UG 0 lan1 0

Hi Muthu... that is the my netstat -rnv

you said that i could assign a default gw to each interface right. so do i do that by editing my netconf file in rc.config.d?

arun... thanks for the sam update, but i dont think that sam allows to configure any deafult gateways on the interfaces, just the IP and the netmask and the broadcast address

cheers,
sid
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Hi Sid,

Take a look at these links,

http://www.faqs.org/faqs/hp/hpux-faq/section-120.html
http://www.faqs.org/faqs/hp/hpux-faq/section-113.html
http://docs.hp.com/en/B2355-90796/ch07s01.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Yes. You have to update it with /etc/rc.config.d/netconf file for permanet routing setting. If you set with route then it is applicable to that session only.

Else you can add that routing setting command with startup scripts. It is not good do this always.

Fill this:

ROUTE_DESTINATION1]="network | ip"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="gateway"
ROUTE_COUNT[1]="1" # Try to change based on route man page prefix setting
ROUTE_ARGS[1]=""


--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

For putting ROUTE_COUNT setting use as,

Count Destination Type Flags
________________________________
=0 network U

>0 network UG

=0 host UH

>0 host UGH

=0 default U

>0 default UG

________________________________


Take flag from netstat -rnv output and use that count in that setting.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Hi Sid,

# Internet routing configuration. See route(1m), routing(7)
#
# ROUTE_DESTINATION: Destination hostname (in /etc/hosts) or host or network
# IP address in decimal-dot notation, preceded by the word
# "host" or "net"; or simply the word "default".
#
# ROUTE_MASK: Subnetwork mask in decimal-dot notation, or C language
# hexadecimal notation. This is an optional field.
# A IP address, subnet mask pair uniquely identifies
# a subnet to be reached. If a subnet mask is not given,
# then the system will assign the longest subnet mask
# of the configured network interfaces to this route.
# If there is no matching subnet mask, then the system
# will assign the default network mask as the route's
# subnet mask.
#
# ROUTE_GATEWAY: Gateway hostname (in /etc/hosts) or IP address in
# decimal-dot notation. If local interface, must use the
# same form as used for IP_ADDRESS above (hostname or
# decimal-dot notation). If loopback interface, i.e.,
# 127.0.0.1, the ROUTE_COUNT must be set to zero.
#
# ROUTE_COUNT: An integer that indicates whether the gateway is a
# remote interface (one) or the local interface (zero)
# or loopback interface (e.g., 127.*).
#
# ROUTE_ARGS: Route command arguments and options. This variable
# may contain a combination of the following arguments:
# "-f", "-n" and "-p pmtu".
#
# For each additional route, add a set of variable assignments like the ones
# below, changing the index to "[1]", "[2]" et cetera.
#
# IMPORTANT: for 9.x-to-10.0 transition, do not put blank lines between
# the next set of statements

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=172.23.150.2
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""

# Dynamic routing daemon configuration. See gated(1m)
#
# GATED: Set to 1 to start gated daemon.
# GATED_ARGS: Arguments to the gated daemon.

GATED=0
GATED_ARGS=""

#
# Router Discover Protocol daemon configuration. See rdpd(1m)
#
# RDPD: Set to 1 to start rdpd daemon
#

RDPD=0

#
# Reverse ARP daemon configuration. See rarpd(1m)
#
# RARP: Set to 1 to start rarpd daemon
#

RARP=0


-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Can you post this up:

grep -Ev '^#|^$' /etc/rc.config.d/netconf | grep ROUTE

to configure netconf file with your route settings.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Muthukumar_5
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

I hope only the routing of,

192.168.0.0/255.255.255.0 10.154.231.253 UG 0 lan0 0

is needing netconf file setting. Since other interface must be default and configured with INTERFACE_NAME setting.

For this:

ROUTE_DESTINATION[1]="192.168.0.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="10.154.231.253"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""


If you are using 1 as ROUTE_*[index] setting then increase that.

That is it.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Hi Sid,

Take a look at HP-UX Lan administrator guide for editing LAN configuration files,

http://docs.hp.com/en/B2355-90796/ch03s04.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"

Re: Configuring multiple Interfaces on HP-UX

Arun, muthu... that really helps... but just one question on that ... as the route_destination, for the ROUTE_DESTINATION, for other than the default, what would be a value to put in there?

Will try all of this tomm morning ... leavin for the day now... sorry could not assign points for ur previous replies... the system appeared to be down... more clarification would be rewarded generously :)

Cheers,
Sid
Arunvijai_4
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Hi Sid,

As the description says,
#
# ROUTE_DESTINATION: Destination hostname (in /etc/hosts) or host or network
# IP address in decimal-dot notation, preceded by the word
# "host" or "net"; or simply the word "default".

You can give any host name or network name proceded by "host" or "net"

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"

Re: Configuring multiple Interfaces on HP-UX

Hi Arun, Muthu... thanks for all your help. If I could get one last clarification.

Arun with ur previous reply, i get that one can set default for more than one NIC on the same subent right.

Also guys does anyone have any more information on the link which one of you sent me about the ip_strong_es_model. Am i correct in assuming that this is something that is not inbuilt and has to be installed separately?

Cheers,
Sid
rick jones
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

ip_strong_es_model is an ndd setting that tells the routing code to include source IP addresses in the route selection. when combined with multiple default routes, it can give the behaviour of per-interface default routes.

the downside is that with ip_strong_es_model set IP datagrams will only be accepted on NICs to which the matching IP address has been assigned.

there may still be some "gotcha's" for applications that call connect() without binding to a local IP address - it is conceivable that the routing code may select an outbound path other than the one you might want. in that case, adding specific static routes is the way to go.
there is no rest for the wicked yet the virtuous have no pillows

Re: Configuring multiple Interfaces on HP-UX

Thanks for that rick. While on that, was wondering if i need to change the ip_strong_es_model to 1, is it a prerequisite that i have install TOUR 2.4 and all its dependent patches? just to give you a background of my problem, I am not actually looking to load balance my NICs, my requirement is to actually configure 4 NICs on the the same subnet ffffff00 but different networks, all 4 NICs are to be used for a different purpose, what i have done till now is that setup the NICs by giving them an IP address through SAM and then configured 4 different default routes through SAM for each of the interface, but the server acts differently each time I set a new default route, but when I take it out, the other NICs work.

Any light on the TOUR2.4 though, if it is needed to make my routeing work?

cheers,
Sid
rick jones
Honored Contributor
Solution

Re: Configuring multiple Interfaces on HP-UX

I'm not quite sure what you mean by same subnet but different networks - you mean that the same IP subnet, but disjoint network infrastructure without any interconnection other than your system?

if so, then you are in what may only be semi-supported territory (it has been a moving target) and would almost certainly need to set ip_strong_es_model. ip_strong_es_model has no dependency on a given TOUR (IIRC) unless one of the tours introduces the "semi-strong" es model - that would be where the route selection still uses the source IP address, but acceptance of datagrams is not limited to the interface with the matchine IP. I have no idea if that has shipped ina given TOUR or release

without ip_strong_es_model, the default gateway used should be considered random, although it will likely be either the first or last configured - I say random because no one should _ever_ depend on it remaining the first or the last
there is no rest for the wicked yet the virtuous have no pillows
Steven E. Protter
Exalted Contributor

Re: Configuring multiple Interfaces on HP-UX

Shalom Sidharth,

Basic rule applies.

No two interfaces can be on the same network.

I'm not talking about physical wire here, I'm talking about network and host.

If your ip is 192.168.0.20 and your subnet is 255.255.255.0 then the network is 192.168.0 and the hsot is 20.

If you try and bring of a second NIC on the 192.168.0 network under HP-UX, the results are often spectaculary.

As to your original question, concerning default gateways, one is sufficient.

You can have secondary routes, in netconf as others have indicated but must choose which the default route is. I generally pick default route for the Interface I'm getting Internet access to to insure good access patchs and downloads.

One post, of reasonable length. I'll respond again only if you seek clarification from me.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: Configuring multiple Interfaces on HP-UX

Thanks for that rick... I am in the gray area what you are talking about. I might have not option but to actually try to reduce the number of active interfaces to make everything work properly.

Steve/Rick,

what I am trying to achieve in my scenario is to actually make the machine part of two different environments, since the management did not want to go for a dual boot, I have set up different filesystems for both "virtual" machines, and I am trying to route traffic to each logical machine to make it kind of a separate entity.

I will post the results after i try out the ip_strong_es_model to 1...

thanks for the help guys, while im here one quick clarification, what are my options of impolementing a sort of a virtual server in HP-UX? (trying to draw parallel to the windows world wherein its possible to run a totally independent virtual machine on top of the physical server)

cheers,
sid
rick jones
Honored Contributor

Re: Configuring multiple Interfaces on HP-UX

Depending on your hardware, for virtualization there are a number of options. One is nPars - hardware partitions on a cell-based system. Next would be vPars - software/firmware split of systems in units of whole CPUs. If you are on Itanium hardware, HP recently started shippnig what I think we are calling HP VM - what we used to call IVM (Itanium Virtual Machine) - think vmware for HP Integrtity servers.

Within a single OS image there is also the workload manager to assign fractions of total resources to different applications.

Also, you _can_ assign multiple IP addresses to a single interface. The transport has no problem with this, and unless you have some serious bandwidth issues with the applications, may be preferable to trying to have mulitple NICs in the same IP subnet. You could even take the multiple NICs you have, gather them into a link aggregate with Auto Port Aggregation, and assign all the IPs to the link aggregate. Then you have NIC HA.
there is no rest for the wicked yet the virtuous have no pillows

Re: Configuring multiple Interfaces on HP-UX

grateful to everyone for the suggestions. Got the routing working by configuring the /etc/rc.config.d/netconf file properly.

had built my system from an ignite image of another system. After a lotta cleaning up and configuring routes towards networks by using the net before the Network IP in the ROUTE_DESTINATION field, got everything working.

Cheers,
sid