Operating System - HP-UX
1822158 Members
3773 Online
109640 Solutions
New Discussion юеВ

assigning multiple IP address to a single NIC card

 
sheevm
Regular Advisor

assigning multiple IP address to a single NIC card

Hi All,

Can we do this in HP-UX 11.23? Has anyone done this before? What are the advantage and disadvantage? I appreciate your comments in advance.

Thanks
kesh
be good and do good
8 REPLIES 8
Gary L. Paveza, Jr.
Trusted Contributor

Re: assigning multiple IP address to a single NIC card

This can be done quite easily. This is used all the time in ServiceGuard environments. You can do it quite easily in SAM. One thing is that I believe it is still required that all addresses reside on the same subnet.
Steven E. Protter
Exalted Contributor

Re: assigning multiple IP address to a single NIC card

Shalom,

Yes,

Its call virtual networking.

You create a virtual ip address on the same network and subnet as the parent.

You do it in /etc/rc.config.d/netconf

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.3.3.104
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=10.3.3.255
INTERFACE_STATE[0]=up
DHCP_ENABLE[0]=0

Add the virtual interface


INTERFACE_NAME[1]=lan0:1
IP_ADDRESS[1]=10.3.3.105
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=10.3.3.255
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0

Then restart the system or networking.

I think it works just find and use this feature when needed.

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
John Payne_2
Honored Contributor

Re: assigning multiple IP address to a single NIC card

Kesh,

ifconfig. (see man ifconfig.)

ifconfig lan1 10.11.61.41 netmask 255.255.255.0 up

Then for a 2nd IP,

ifconfig lan1:1 10.11.62.42 netmask 255.255.255.0

It's done all the time.

As far as the advantage/disadvantage, that depends on what you really want to do...

John
Spoon!!!!
rick jones
Honored Contributor

Re: assigning multiple IP address to a single NIC card

Gary - the same subnet bit was an ancient restriction on 10.20. I do not recall that 11.X ever had that restriction.
there is no rest for the wicked yet the virtuous have no pillows
Patrick Wallek
Honored Contributor

Re: assigning multiple IP address to a single NIC card

One thing to consider when assigning multiple IP's, especially if they are in a different subnet, is whether or not your switch / router will support it.

Say your primary IP on a card (lan0) is 1.2.3.4 with a 255.255.255.0 subnet mask. You are plugged into a switch port that is set up for the 1.2.3 network. This is pretty normal and should work pretty well.

Now, say you add an additional IP to this card (lan0:1) of 1.2.4.5 with a subnet mask of 255.255.255.0. Remember that you are still plugged into a switch port set for 1.2.3 network. The 1.2.4.5 address will likely be essentially useless since it can't get anywhere on the switch since it is not part of the 1.2.3 network.

The restriction for having the addresses on the same subnet may not be a HP-UX restriction anymore, but you must consider your network setup very carefully.
rick jones
Honored Contributor

Re: assigning multiple IP address to a single NIC card

By and large a _switch_ shouldn't care. A switch should only operate at the data-link layer - ie layer2, eg MAC/Ethernet addressing. It shouldn't care one whit about the what is above the Ethernet header. Otherwise, it isn't a "switch."

A "router" on the other hand will indeed care about what is in the IP header.
there is no rest for the wicked yet the virtuous have no pillows
Patrick Wallek
Honored Contributor

Re: assigning multiple IP address to a single NIC card

Rick,

I agree, somewhat. But if you have a switch that is set up with VLANs. Say ports 1-5 are VLAN3 (1.2.3.x) and port 6-10 are VLAN4 (1.2.4.x).

Then if the HP-UX is attached to port 3 then a 1.2.3 address for lan0 will work, BUT a 1.2.4 address for lan0:1 may not.
rick jones
Honored Contributor

Re: assigning multiple IP address to a single NIC card

Only if those IP subnets are administratively assigned to be in separate vlans, and then the switch still isn't looking at IP addresses, but vlan tags :)
there is no rest for the wicked yet the virtuous have no pillows