Open port with iptables | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Open port with iptables

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-18-2012
Duffs22 Duffs22 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 31 January 2014, 5:16 AM EST
Posts: 112
Thanks: 18
Thanked 1 Time in 1 Post
Open port with iptables

Hi,

What iptables command do I need to run in order to open up the following port for incomming traffic on the following server:


Code:
# telnet 127.0.0.1 1521
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused

R,
D.
Sponsored Links
    #2  
Old 05-18-2012
admin_xor's Avatar
admin_xor admin_xor is offline
Registered User
 
Join Date: Jun 2011
Last Activity: 8 April 2014, 5:55 AM EDT
Posts: 452
Thanks: 13
Thanked 79 Times in 76 Posts
Add the following line in /etc/sysconfig/iptables before the FORWARD chain:

Code:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

And restart the iptables service:

Code:
service iptables restart

Check if the port is open now:

Code:
iptables -L

Sponsored Links
    #3  
Old 05-24-2012
nicks nicks is offline
Registered User
 
Join Date: May 2012
Last Activity: 24 May 2012, 2:21 AM EDT
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Kindly run the following command sequences on root terminal.

iptables -I INPUT -m state --state NEW -p tcp --dport 1521 -j ACCEPT
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
/etc/init.d/iptables save
The Following User Says Thank You to nicks For This Useful Post:
cars4boys (12-12-2012)
    #4  
Old 05-24-2012
makentosh makentosh is offline
Registered User
 
Join Date: May 2012
Last Activity: 24 May 2012, 5:31 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
iptables -A INPUT -p tcp -m tcp --dport 1521 -j ACCEPT
iptables save
service iptables restart
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
iptables & port 53 (DNS) Duffs22 Red Hat 9 04-19-2012 12:03 PM
Ip And Port Divertion Through Iptables kgrvamsi UNIX for Advanced & Expert Users 0 05-11-2011 11:16 AM
copy packets from one port to another by iptables yanat UNIX for Advanced & Expert Users 1 04-12-2011 01:46 PM
Using iptables to allow only certain IPs for a Port netxus UNIX for Dummies Questions & Answers 0 02-23-2010 09:36 PM
iptables: forwarding a port meeps UNIX for Dummies Questions & Answers 1 11-23-2003 03:37 AM



All times are GMT -4. The time now is 07:44 AM.