?
Solved

How to open port 1521 and port 1158 on redhat

Posted on 2011-09-05
11
Medium Priority
?
22,611 Views
Last Modified: 2012-05-12
I want to know how to open port 1521 et 1158 (for oracle ...) on redhat linux.

I have used the procedure bellow but it doesn't seem to work


#vi /etc/sysconfig/iptables


add this line
# -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1158 -j ACCEPT
# -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 1521 -j ACCEPT

Restart IPTABLES
# /etc/init.d/iptables restart

verify that the ports are open
#netstat | grep 1158
#netstat | grep 1521
0
Comment
Question by:cismoney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 29

Expert Comment

by:fosiul01
ID: 36483614
are there any services running on port 1158 and 1521 ??

netstat output will only show if somethign is runnign on those port
0
 

Author Comment

by:cismoney
ID: 36483644
yes some oracle services are supposed to run on these ports. the dba told me to open these sports
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 36483647
telnet you can telnet to those port

telnet localhost   1158

or

telnet ip-of-server 1158

see if you can connect or not
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:cismoney
ID: 36483682
can't connect via telnet

here is the output

# telnet localhost 1158
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

Open in new window

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 36483688
the output shows its connected   ::: Escape character is '^]'.


here you trying from localhost

could you try from another computer in your network ??


from different computer in your network  (xp or another linux)

telnet ip-of-server 1158

0
 

Author Comment

by:cismoney
ID: 36483735
the result is the same
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 36483754
if you can telnet to  1158 from out side of the server
which mean, the port is opened


Now if you cant telnet 1521 from out side of server
which means , the services is not enabled on that port

or you have not open that port from firewall  

but by looking at yoru question, its lik port 1521 (tcp ) is open

do this

lsof -iTCP | grep 1521

lsof -iTCP | grep 1558

see what runnign on those port




0
 

Author Comment

by:cismoney
ID: 36483783
i just typed these two command and there is no output
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 36483793

sorry its 1158  not 1558



lsof -iTCP | grep 1158
0
 
LVL 79

Accepted Solution

by:
arnold earned 2000 total points
ID: 36483853
As fosiul01 pointed
lsof -i:<portnumber>
if there is a process that is bound to this port, you will get the listing.

The procedure you followed depends on where you placed those two lines.
Presumably you do not have an explicit deny after which you add the referenced lines.

Try this:
iptables -L RH-Firewall-1-INPUT --line-numbers

iptables -I RH-Firewall-1-INPUT <x> -p tcp –dport 1158 -j ACCEPT
iptables -I RH-Firewall-1-INPUT <x> -p tcp –dport 1121 -j ACCEPT

(running the above commands makes the changes effective immediately but a restart of the iptables or the system will revert back since these changes are unsaved until you run /etc/init.d/iptables save)

Where <x> is replaced with a row number (depending on how many lines in your existing chain, 4,5 or 6 should be fine to use.  Make sure you do not have a Deny/Reject rule after which you are adding these entries.

Double check that you did not alter the ports
http://download.oracle.com/docs/cd/B19306_01/install.102/b15660/app_port.htm

netstat -an | egrep '(1158|1121)'

Fosiul01 pointed out that the connection is made, but the process might involve encryption which might explain why you are not seing anything after the connection is established.
0
 

Author Comment

by:cismoney
ID: 36484763
it worked !!! thanx. i just found out  this command
 #system-config-securitylevel

Open in new window



its very easy to use, it display the firewall graphical interface with xterm
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Understanding FTPS File transfer is a common requirement in most Enterprises. While there are numerous ways to get a file from Point A to Point B over a network, perhaps the most common method still in use is FTP – File Transfer Protocol. FTP is …
SSL is a very common protocol used these days when browsing the web.  The purpose is to provide security to communication, but how does it do it?  There are several pieces at work that have to be setup before SSL will even work and it requires both …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question