Operating System - HP-UX
1833780 Members
2886 Online
110063 Solutions
New Discussion

How to give the IP address for a single Network card?

 
SOLVED
Go to solution
unixguy_1
Regular Advisor

How to give the IP address for a single Network card?

Dear Friends,

i want to give the 2 Ipaddress for a single Netowrk card and is it where will stored that IP details.

Pls anyone help to me....

Regards,
Unixguy.



8 REPLIES 8
Analyst
Trusted Contributor
Solution

Re: How to give the IP address for a single Network card?

HI Unixguy,

Multiple IP addresses assigned to the same interface may be in different subnets. An example of an interface name without an IP index number is lan0. An example of an interface name with a IP index number is lan0:1. Note: specifying lan0:0 is equivalent to lan0.

A primary interface is an interface whose IP index number is zero. A secondary interface is an interface whose IP index number is non-zero.
Hasan  Atasoy
Honored Contributor

Re: How to give the IP address for a single Network card?

hi ;

ip details stored in the /etc/rc.config.d/netconf file. you can add seconday by using sam.

sam - networking and comm - network interface cards - choose your card and from actions add logical ip.


Hasan.
likid0
Honored Contributor

Re: How to give the IP address for a single Network card?

If you need and alias, from the comand line(you loos it after reboot) is:

ifconfig lan0:1 ip mask etc


if you wan't to make it permanent, in /etc/rc.config.d/netconf

something like:

IP_ADDRESS[1]=10.10.10.1
SUBNET_MASK[1]=255.255.252.0
INTERFACE_NAME[1]=lan0:1
BROADCAST_ADDRESS[1]=10.10.11.255
INTERFACE_STATE[1]=up
Windows?, no thanks
unixguy_1
Regular Advisor

Re: How to give the IP address for a single Network card?


Hi,

Iam not able to understand,pls kindly give the step by step.

Regards,
Unixguy.
Ganesan R
Honored Contributor

Re: How to give the IP address for a single Network card?

Hi,

You can assign more than one ip address on single ethernet card.


You can do it through command line or manually editing the /etc/rc.config.d/netconf file.

But the easiest way is to do it through SAM.
Goto SAM --> Network interface cards --> Select the interface which you want to add second ip --> actions --> Add ip logical interface --> Here you can specifiy new ip address and hostname

If you do it through SAM you don't need to edit config file(netconf) manually. System will modify everything.

What actually happening here is, system is creating Logical interface(like lan0:1) over the physical interface(lan0) and assigning the new ip on it.

Hope you understand now.
Best wishes,

Ganesh.
likid0
Honored Contributor

Re: How to give the IP address for a single Network card?

yes, lets say you wan't to add on lan0 and alias with:
ip :10.10.10.1
mask :255.255.252.0

you can do it by hand:

ifconfig lan0:1 10.10.10.1 netmask 255.255.252.0


And if you wan't to make it permanent:
vi /etc/rc.config.d/netconf

and you add at the end of the file:

IP_ADDRESS[1]=10.10.10.1
SUBNET_MASK[1]=255.255.252.0
INTERFACE_NAME[1]=lan0:1
BROADCAST_ADDRESS[1]=10.10.11.255
INTERFACE_STATE[1]=up


Windows?, no thanks
unixguy_1
Regular Advisor

Re: How to give the IP address for a single Network card?


Thanks a lot Friends,

I understood.

Thanks for ur kind reply.

Regards,
Unixguy.
unixguy_1
Regular Advisor

Re: How to give the IP address for a single Network card?


Thanks a Lot Friends,

I got the solution.

It's resolved.

Regards,
Unixguy.