Use iptables firewall to allow port 1521 to be connected

Source: Internet
Author: User

Today, I accessed a new Oracle 10 Gb database in the data center. As a result, Oracle SQLl Developer could not connect to the database, and I was dizzy, so I had to check the database and found that TNS was configured, it's okay to log on to the server.

When I was confused, I was reminded that "is the linux firewall blocked ?"

First, use iptables to view the current rule: iptables-L-n, for example:

Only a few ports are allowed to be connected, so enable iptables to open port 1521 to allow this port to be connected:

First:

# Vi/etc/sysconfig/iptables

 

Join:

-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 1521-j ACCEPT

 

Save and exit the vi editor. Then:

# Service iptables save

# Service iptables restart

 

Service iptables save to save the new rule. Otherwise, restart the machine and restore it to its original state.

Then I connected it with SQL Developer. It was a success! Haha.

Check iptables-L-n again. port 1521 has been allowed to be connected by iptables, as shown in the red box section:

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.