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

configure a second IP to a ethernet card

 
uadm26
Super Advisor

configure a second IP to a ethernet card

Hi,

How con configure a second ip to an ethernet card?
I need only to use ifconfig?
Not in lan0 but in lan1.
9 REPLIES 9
Gopi Sekar
Honored Contributor

Re: configure a second IP to a ethernet card


I believe you can use ethernet alias.

just check alias options in ifconfig (lan0:1)

Hope this helps,
Gopi
Never Never Never Giveup
Geoff Wild
Honored Contributor

Re: configure a second IP to a ethernet card

Add it to the /etc/rc.config.d/netconf file:

Example:

IP_ADDRESS[1]=192.168.164.97
SUBNET_MASK[1]=255.255.248.0
INTERFACE_NAME[1]=lan1:1
BROADCAST_ADDRESS[1]=192.168.167.255
INTERFACE_STATE[1]=up


ifconfig lan1:1 up

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Doug O'Leary
Honored Contributor

Re: configure a second IP to a ethernet card

Using Geoff's suggestion would make the network configuration permanent and would automatically configure the new IP on a reboot. This is more than likely what you want to do.

If you're looking to test it out or for a more temporary solution, you can configure it manually via ifconfig command:

ifconfig lan1:1 inet ${ip} netmask ${nm} broadcast ${bc} up

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
uadm26
Super Advisor

Re: configure a second IP to a ethernet card

ok, I have done, but now I have, for example:
# traceroute alfa

traceroute: Warning: Multiple interfaces found; using 172.20.192.133 @ lan0:1
traceroute to alfa (172.20.102.123), 30 hops max, 40 byte packets
1 alfa (172.20.102.123) 0.270 ms 0.138 ms 0.135 ms


But I want to use lan1:1 :
# traceroute alfa

traceroute: Warning: Multiple interfaces found; using 172.20.102.169 @ lan1:1
traceroute to alfa (172.20.102.123), 30 hops max, 40 byte packets
1 alfa (172.20.102.123) 0.270 ms 0.138 ms 0.135 ms

How?
Geoff Wild
Honored Contributor

Re: configure a second IP to a ethernet card

man traceroute

Specify the interface with -i

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
uadm26
Super Advisor

Re: configure a second IP to a ethernet card

ok, but traceroute -i just do it in that time not permanently, I want to change use lan0:0 to use lan1:1.
jayachandran.g
Regular Advisor

Re: configure a second IP to a ethernet card

Hi

Try

route add command this may solve your problem.

route add "dest ip" "lan1:1 ip"

bye bye
Jayachandran.G

陳文賢
Advisor

Re: configure a second IP to a ethernet card

Sir :

I can't find the path and file "etc/rc.config.d/netconf " ,my o.s is Tru64 5.1B , if I wnat to add second ip address ,how to do ?
Mel Burslan
Honored Contributor

Re: configure a second IP to a ethernet card

You need to ask your question at the tru64 forums. This forum is HPUX only. Here is the lin to tru64 forums:

http://forums1.itrc.hp.com/service/forums/familyhome.do?familyId=280
________________________________
UNIX because I majored in cryptology...