Networking Forums

Networking Forums > Computer Networking > Linux Networking > changed port

Reply
 
 
Serge Blokhin
Guest
Posts: n/a

 
      04-15-2004, 10:15 PM
Hi All,
I am new in linux so the question may be easy,
I have an app which is listening specific port for incoming
connections.
I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
7.2 ) it's not working.
When i run netstat -l it shows that my app is listening 25115 port,
which is kinda strange 'cause I wanted it to listen 7010...
If i try to connect to the linux box on 25115 port i get the
connection but non on 7010. So it looks like somehow linux changes
listening port for my app...
Can somebody explain me why it is happening?
Thanks
Serge
 
Reply With Quote
 
 
 
 
Alex Harsch
Guest
Posts: n/a

 
      04-15-2004, 11:21 PM
Serge Blokhin wrote:

> Hi All,
> I am new in linux so the question may be easy,
> I have an app which is listening specific port for incoming
> connections.
> I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
> 7.2 ) it's not working.
> When i run netstat -l it shows that my app is listening 25115 port,
> which is kinda strange 'cause I wanted it to listen 7010...
> If i try to connect to the linux box on 25115 port i get the
> connection but non on 7010. So it looks like somehow linux changes
> listening port for my app...
> Can somebody explain me why it is happening?
> Thanks
> Serge

Hi,

on some Linux Systems, you are not allowed to use the registered ports. Port
7010 is used for
ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
ups-onlinet 7010/udp # onlinet uninterruptable power supplies


Alex
 
Reply With Quote
 
Serge Blokhin
Guest
Posts: n/a

 
      04-16-2004, 02:24 PM
Alex Harsch <(E-Mail Removed)> wrote in message news:<c5n5d9$10vd$(E-Mail Removed)>...

Hi Alex,

> Hi,
>
> on some Linux Systems, you are not allowed to use the registered ports. Port
> 7010 is used for
> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
>
>
> Alex


Well, tried other ports, same thing.
Something changes ports...
Serge
 
Reply With Quote
 
Alex Harsch
Guest
Posts: n/a

 
      04-16-2004, 05:38 PM
Serge Blokhin wrote:

> Alex Harsch <(E-Mail Removed)> wrote in message
> news:<c5n5d9$10vd$(E-Mail Removed)>...
>
> Hi Alex,
>
>> Hi,
>>
>> on some Linux Systems, you are not allowed to use the registered ports.
>> Port 7010 is used for
>> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
>> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
>>
>>
>> Alex

>
> Well, tried other ports, same thing.
> Something changes ports...
> Serge

Hi Serge,

have you already tried a private port?
The Dynamic and/or Private Ports are those from 49152 through 65535.

They are for private use, and I guess your system will let you use one of
these.
Regards, Alex
 
Reply With Quote
 
Serge Blokhin
Guest
Posts: n/a

 
      04-16-2004, 10:23 PM
Hi Alex,
I think I know what's going....
I guess it all comes to playing with big-endian/little-endian stuff.
so my problem has nothing to do with linux itself...
Thanks for your help anyway.
Serge

> Serge Blokhin wrote:
>
> > Alex Harsch <(E-Mail Removed)> wrote in message
> > news:<c5n5d9$10vd$(E-Mail Removed)>...
> >
> > Hi Alex,
> >
> >> Hi,
> >>
> >> on some Linux Systems, you are not allowed to use the registered ports.
> >> Port 7010 is used for
> >> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
> >> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
> >>
> >>
> >> Alex

> >
> > Well, tried other ports, same thing.
> > Something changes ports...
> > Serge

> Hi Serge,
>
> have you already tried a private port?
> The Dynamic and/or Private Ports are those from 49152 through 65535.
>
> They are for private use, and I guess your system will let you use one of
> these.
> Regards, Alex

 
Reply With Quote
 
Juha Laiho
Guest
Posts: n/a

 
      04-25-2004, 09:07 AM
(E-Mail Removed) (Serge Blokhin) said:
>I have an app which is listening specific port for incoming
>connections.
>I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
>7.2 ) it's not working.
>When i run netstat -l it shows that my app is listening 25115 port,
>which is kinda strange 'cause I wanted it to listen 7010...


You found out correct, this is because of endian issues.
So, showing the 7010 in hexadecimal gives 1B62. With the endian
mismatch, this gets interpreted as 621B, which is 25115 decimal.

To solve this for port numbers, the applications should always use
htons() to transform the port number from the host byte order to
network byte order. Similarly, some data retrieved form the network
interface functions must be converted back to host byte order with
ntohs(). These practices make the same code work on all platforms.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Puplic IP changed Len K Windows Networking 5 02-21-2008 03:48 PM
DNS Changed - by what? Nobody Home Networking 5 09-11-2005 04:18 PM
Changed NIC now no connection =?Utf-8?B?REMgV29ybQ==?= Windows Networking 4 11-20-2004 03:30 PM
Changed ip address Chubb Broadband Hardware 2 08-28-2004 12:47 AM
Changed 192.168.0.1 to something else Marvin G Windows Networking 5 10-05-2003 03:49 PM



1 2 3 4 5 6 7 8 9 10 11