Operating System - HP-UX
1833753 Members
2385 Online
110063 Solutions
New Discussion

2 IP address with one nic card

 
Juan Leon_2
Occasional Contributor

2 IP address with one nic card

Hi, I have a 9000 server class J it is a little bit old, I installed HPUX 11.0 and I would like to configure appache. But I have a problem trying to configure the ip address on one nic. I wan to have the following settings

lan0 192.168.0.XXX 255.255.255.0
lan0:1 68.82.XXX.XXX 255.255.255.0

my default gateway is 192.168.0.1

I updated the /etc/rc.config.d/netconf file with the information. but when I reboot the server either the server hungs when trying to configure the card or just fails and continue with the rest of rc scripts.
can someone giveme a idea of how can I approach this problem without install a second NIC.
10 REPLIES 10
Michael Schulte zur Sur
Honored Contributor

Re: 2 IP address with one nic card

Hi,

I am sorry to disappoint you, but one nic, one address. Why do you need a second address at all? If you do, you need a second nic.

greetings,

Michael
G. Vrijhoeven
Honored Contributor

Re: 2 IP address with one nic card

Hi,

This will work, but it is not supported:

ifconfig lan?:? netmask

Gideon
Juan Leon_2
Occasional Contributor

Re: 2 IP address with one nic card

one IP address will be my LAN connection and the other IP is my WAN connection I want to run a webserver on this machine
Hoefnix
Honored Contributor

Re: 2 IP address with one nic card

From security perspec this is someting you don't want.
Instal a firewal in between and you don't need that second IP on this NIC.

Regards,

Peter
G. Vrijhoeven
Honored Contributor

Re: 2 IP address with one nic card

Hi Juan,

I would not advise you to put two ipadresses on the NIC. It is better to set up NAT on the firewall if possible. The second problem you have is if your server is connected to a switch you must have multiple ip-ranges in the vlan. Or connect the system to a HUP. So it is performance / secutiry wise no good idea for a webserver.

Gideon
Sergejs Svitnevs
Honored Contributor

Re: 2 IP address with one nic card

for TEST use:
ifconfig lan0:1 68.82.XXX.XXX netmask 255.255.255.0

for LONG TIME use add an info to /etc/rc.config.d/netconf file about new virtual interface:

INTERFACE_NAME[1]="lan0:1"
IP_ADDRESS[0]="68.82.XXX.XXX"
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]="68.82.XXX.255"

Regards,
Sergejs
Fabio Ettore
Honored Contributor

Re: 2 IP address with one nic card

Hi,

for your information it is possible to configure two IP addresses on the same NIC card by APA (Auto Port Aggregation) and even on the same subnet:

http://www.docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/J4240-90016/J4240-90016_top.html&con=/hpux/onlinedocs/J4240-90016/00/00/1-con.html&toc=/hpux/onlinedocs/J4240-90016/00/00/1-toc.html&searchterms=apa&queryid=20040120-032752

I hope this helps you.

Best regards,
Ettore
WISH? IMPROVEMENT!
Michael Schulte zur Sur
Honored Contributor

Re: 2 IP address with one nic card

Hi Ettore,

I understand it differently than you. APA/link aggregation allows you to combine more than one nic under one address and balance the network traffic.

Michael
Geoff Wild
Honored Contributor

Re: 2 IP address with one nic card

You should be able to configure multiple ip's on a single card.

The issue I think you have - is you want 1 to be internal and 1 for your WAN - won't work - how can you configure your hub/switch to route? With your DGW at 192.168.0.1 - that means 68.82.whatever can NOT go anywhere....

As others have suggested - you need 2 nics for this - or, a firewall that NAT's to your primary interface from the WAN...

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.
Steven E. Protter
Exalted Contributor

Re: 2 IP address with one nic card

You can have as many virtual ip addresses on ne NIC card as you want.

Thats done long term in /etc/rc.config.d/netconf as noted above.

The only possible issue is the two addresses are not compatible for some reason.

You can work that out by testing the configuration for lan0:1 and the ifconfig command.

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