General
cancel
Showing results for 
Search instead for 
Did you mean: 

Two Servcies need the same port number

Sagar Sirdesai
Trusted Contributor

Two Servcies need the same port number

Hi
We have two applications which need to use same port number.

Is it possible to configure same port number to two services.

The OS is HP-UX 11.31

Sagar
7 REPLIES
Torsten.
Acclaimed Contributor

Re: Two Servcies need the same port number

I don't think so.

Only a single process can listen on a port.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sagar Sirdesai
Trusted Contributor

Re: Two Servcies need the same port number

Thanks Torsten,

If two entries exists will first entry in services get preferance
Torsten.
Acclaimed Contributor

Re: Two Servcies need the same port number

/etc/services is not really related.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sagar Sirdesai
Trusted Contributor

Re: Two Servcies need the same port number

HI

I'll make entries in the /etc/services file with service name and ports.

Please elaborate how services is not relevant here

Sagar

Prasanth V Aravind
Trusted Contributor

Re: Two Servcies need the same port number

Yes .. it possible to configure same port number to two services

But its not possible to run both applications simultaneously.

only one will be running at a time.

Gudluck
Prasanth

Torsten.
Acclaimed Contributor

Re: Two Servcies need the same port number

See my post here:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1432551

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Matti_Kurkela
Honored Contributor

Re: Two Servcies need the same port number

This may be possible, but only if both applications have an option to bind them to a specific network interface/IP address only.

If your network is, for example, 10.20.30.0/24, and your server has IP address 10.20.30.101 configured to its NIC (lan0 for example) now, you should allocate a second IP address from the same network segement. Let's say it's 10.20.30.102.

Then set up a IP alias lan0:1 with the IP address 10.20.30.102 and the same netmask as the original IP address.

If you want to test it, it can be set up with a simple ifconfig command:

ifconfig lan0:1 10.20.30.102 netmask 255.255.255.0

(If you're familiar with editing /etc/rc.config.d/netconf, an IP alias can be added to it just like a regular network interface. Simply use "lan0:1" as the interface name.)

Adding a second physical NIC connected to the same network segment and configuring it with the new IP address would not work: you would need APA configuration for that, and you would then have to create an IP alias on top of the APA aggregate anyway.

When your IP alias is running and you can ping it from other systems on the same network, you can start configuring your applications. Bind one application to each interface (or IP address).

If only one application has an option to bind it to a specific IP address/interface, it might still work as long as you always first start the application that *has* the binding option. But this is a work-around I wouldn't want to use in a production system...

MK
MK