LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2009, 12:19 AM   #1
ytd
Member
 
Registered: Jan 2009
Posts: 205

Rep: Reputation: 31
How do I open a port in Linux CentOS 5 for an Informix server ?


How do I open a port in Linux CentOS 5 for an Informix server ?

in /etc/services I added the service and put in there the port number. Is there any other changes that I should make ?

When I do telnet destionationhost 1526 from a windows machine it tells me that could not open connection to the host on that port. Connect failed.

I know that if a port is open, I should be able to connect with telnet.

My firewall is disabled (policy accept from all - input output, forward, etc all chains)

iptables -A INPUT -i eth0 -p udp --sport 1526 -m state --state ESTABLISHED -j ACCEPT

and -p tcp

iptables -A INPUT -p udp --dport 1526 -j ACCEPT

and -p tcp


still... those commands are useless since the firewall is off by default, did iptables -F in rc.local so everytime when the machine restarts the firewall is "disabled" I mean it accepts all connections.

One more thing, I know that linux boxes have the se linux thing. I remember that when I installed the se linux was disabled, but still... where do I need to disable that if it's enable ? And how do I test it ?


netstat -nap | grep :1526
tcp 0 0 127.0.0.1:1526 0.0.0.0:* LISTEN 7128/oninit

Last edited by ytd; 08-10-2009 at 12:20 AM.
 
Old 08-10-2009, 12:43 AM   #2
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
to disable selinux you need to modify /etc/selinux/config with the following line "SELINUX=disabled"

Can you ping your destinationhost from the windows machine or SSH from there?
 
Old 08-10-2009, 01:01 AM   #3
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by centos82 View Post
to disable selinux you need to modify /etc/selinux/config with the following line "SELINUX=disabled"

Can you ping your destinationhost from the windows machine or SSH from there?
Ofc I can connect to SSH and to ping it. The firewall like I said it's "disabled". I mean it accepts all the connections.

Ok, just as I thought, that selinux was enabled

in selinux/config I had the line
SELINUX=enforcing

now I modify it to disabled

did restart (reboot) and it's still now working. I remember that one month ago when the CentOS 5 and the informix wasn't reinstalled it worked fine.

Let me reformulate. I had the same configuration (I gues) one month ago. Now I have reinstalled the CentOS and informix server and I can't longer connect to the 1526 port using telnet.

Anyway, it was a good one with that selinux to be disabled. Thankx. Any other suggestions, please ?
 
Old 08-10-2009, 01:04 AM   #4
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
Can you telnet localhost 1526 from your CentOS mahcine?
 
Old 08-10-2009, 01:08 AM   #5
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
Quote:
I remember that one month ago when the CentOS 5 and the informix wasn't reinstalled it worked fine.
What do you mean by this? Do you mean you were running CentOS 5, informaix was NOT installed, and telnet <destinationhost> 1526 worked for you?

Last edited by centos82; 08-10-2009 at 01:15 AM.
 
Old 08-10-2009, 01:11 AM   #6
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
Sorry, was having trouble with the quote function.

Last edited by centos82; 08-10-2009 at 01:16 AM.
 
Old 08-10-2009, 01:11 AM   #7
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
centos82 read carefull all what I said. I said that one month ago I had the same configuration, informix server installed and centos installed, now I have reinstalled CentOS and informix server and now the telnet dosen't work on 1526port.

http://www.idevelopment.info/data/Un...TPAsRoot.shtml

I did what they said there, I can connect to telnet as root and use the telnet as a ssh *(putty)
If I telnet from a windows machine to the ip of the server and port 22 it lets me in so it's just fine but dosen't let me connect on port 1526.
 
Old 08-10-2009, 01:17 AM   #8
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
Can you telnet localhost 1526 from your centos server?
 
Old 08-10-2009, 01:24 AM   #9
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by centos82 View Post
Can you telnet localhost 1526 from your centos server?
Yes, I saw that question, didn't answer 'cause I was in other tests.
Yes, it worked.

Connection closed by foreign host.
[root@xxxx ~]# telnet localhost 1526
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
now I pressed enter
Connection closed by foreign host.
[root@xxxx ~]#


It seems that I can connect but only from localhost. What seems to be the problem then ?

One more thing. I am with the windows machine in a domain and the CentOS server dosen't have a DNS name associated in the domain controller. Thing is, I don't remember but I think that one month ago it wasn't the Centos server associated with a dns in the domain controller so I think this isn't the problem but I t hough that I should let you know.

The windows machine is 172.16.12.x and the Centos is 172.16.100.x

If I ping it it replys me, so it's ok.
 
Old 08-10-2009, 01:28 AM   #10
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
I installed mysql-server for a test. I successfully connected to port 3306 via telnet.
 
Old 08-10-2009, 01:38 AM   #11
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
You have an interesting problem. You can connect locally, you can connect to other ports remotely.

What does iptables -L show you?

How many NICs are configured on your CentOS machine?
 
Old 08-10-2009, 01:50 AM   #12
centos82
Member
 
Registered: Sep 2008
Distribution: CentOS
Posts: 75

Rep: Reputation: 16
What does "cat /etc/services |grep 1526" show?

Then "lsof |grep <first 4 character of port listed for 1526"

ex.

(root@ctrl)
[/root]$ cat /etc/services |grep 1526
pdap-np 1526/tcp # Prospero Data Access Prot non-priv
pdap-np 1526/udp # Prospero Data Access Prot non-priv

(root@ctrl)
[/root]$ lsof |grep pdap


I've got nothing running on 1526 so nothing returns from lsof but you should get something if its running.
 
Old 08-10-2009, 01:51 AM   #13
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
Ok, so let's recapitulate:

I have CentOS 5 X86_64 and Informix server 9.40 UC2

1. I can ping the linux machine from the windows machine.
2. I can connect to port 22 using telnet.
3. I can connect to port 3306 *(mysqlserver) from the localhost linux machine server.

[root@xxxx ~]# telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
4
5.0.45!{n4V4B/,b"~w[@l$jma~quit
Bad handshakeConnection closed by foreign host.
[root@xxxx ~]#

4. I can connect to port 3306 *(mysqlserver) from a windows machine using telnet.
5. The iptables are default policy set to accept. Anyway I have added the exception for the port 1526 tcp and udp, just to be done.
6. I have disabled the SE linux enforcing.
7. I can connect to port 1526 to the linux machine but only from the localhost - using root.


[root@xxxx ~]# telnet localhost 1526
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
quit
Connection closed by foreign host.
[root@xxxx ~]#


Dear centos82,

I said I have the policy of iptables (chains) set to accept as default. Did iptables -F and put the exception iptables command for the port 1526, but I'm sure I didn't have to do that. Anyway, here's the output log:


[root@xxxx ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dptdap-np
ACCEPT tcp -- anywhere anywhere tcp dptnserv
ACCEPT udp -- anywhere anywhere udp sptdap-np sta te ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp sptnserv stat e ESTABLISHED

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (0 references)
target prot opt source destination
[root@xxxx ~]#

And you are very right I can connect to 1526 from localhost but can't connect from a remote windows machine.
 
Old 08-10-2009, 01:54 AM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,365

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
According to your 1st post
Quote:
tcp 0 0 127.0.0.1:1526 0.0.0.0:* LISTEN 7128/oninit
which means its only listening on localhost ie 127.0.0.1.
You probably need to change Informix cfg to listen on the relevant IP.
 
Old 08-10-2009, 01:54 AM   #15
ytd
Member
 
Registered: Jan 2009
Posts: 205

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by centos82 View Post
What does "cat /etc/services |grep 1526" show?

Then "lsof |grep <first 4 character of port listed for 1526"

ex.

(root@ctrl)
[/root]$ cat /etc/services |grep 1526
pdap-np 1526/tcp # Prospero Data Access Prot non-priv
pdap-np 1526/udp # Prospero Data Access Prot non-priv

(root@ctrl)
[/root]$ lsof |grep pdap


I've got nothing running on 1526 so nothing returns from lsof but you should get something if its running.

[root@xxxx ~]# cat /etc/services |grep 1526
onserv 1526/tcp #Pt informix server
pdap-np 1526/tcp # Prospero Data Access Prot non-priv
pdap-np 1526/udp # Prospero Data Access Prot non-priv
[root@xxxx ~]#



=====================================================================



[root@xxxx ~]# lsof |grep onserv
oninit 6321 informix 5u IPv4 20644 TCP herculetestnserv (LISTEN)
[root@xxxx ~]#

damn smiley )

[root@xxxx ~]# lsof |grep onserv
oninit 6321 informix 5u IPv4 20644 TCP herculetest: onserv (LISTEN)
[root@xxxx ~]#
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
change hostname of LINUX CentOS 5 while running informix server ytd Linux - General 5 08-11-2009 01:04 AM
Informix server on CentOS 5 error while loading shared libraries: libstdc++-libc6.2-2 ytd Linux - General 1 08-09-2009 02:14 AM
How to open a port on a Centos 5 server swamprat Linux - Newbie 7 04-16-2009 05:54 PM
i need help with centos and csdk informix superbully Linux - Software 0 07-31-2007 03:52 AM
TCP port allocation of Informix in AIX tsarlz AIX 0 10-26-2006 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration