• Arun Kumar

Linux Firewall with iptables and firewalld

In this article will be covering details regarding iptables and firewalld which helps in Linux firewall management. We will also be looking at how to enable specific ports (1521 for Oracle) inside iptables.



Read more about Linux iptables vs Linux firewall

Linux Firewall status

The Linux firewalld command will let you check Linux firewall status. It will show you the current status Active in case firewall is running


systemctl status firewalld


Linux Disable Firewall

For practicing Oracle on Linux, you might need to stop the Linux firewall so that you can connect applications to database listener. Below commands will permanently disable Linux firewall


service firewalld stop
systemctl disable firewalld


Linux Enable Firewall

Just in case you would like to enable Linux firewall after disabling it, use below commands


service firewalld start
systemctl enable firewalld


Enable Ports in Linux

On some servers, port 1521 will not be enabled by default because of security reasons. You can enable this specific port inside linux using below commands.


Enable 1521 Port in Linux

If you are working on Oracle Linux 5 or 6 version, use Linux iptables command to enable specific ports as root user


iptables -I INPUT -p tcp --dport 1521 -j ACCEPT

If you would like to open any specific port in Linux, just replace the port number (1521) with new port number.


Enable Port Range in Linux

To open multiple port ranges in Linux, use below command


iptables -A INPUT -p tcp -m multiport --dports 7101:7200,4889:4898,1159,4899:4908,7788:7809,3872,1830:1849 -j ACCEPT


Enable Port in Oracle Linux 7

In some Linux versions, below command works fine


firewall-cmd  --permanent --add-port=1521/tcp

538 views

Recent Posts

See All

Basic Linux Commands

This article describes basic Linux commands that you must know as a system or database administrator. Below commands in Linux help you manage any Linux server fast and smoothly. Linux Command List Che

Passwordless SSH in Linux

Every time you ssh from one Linux server to another, you need to enter target server user's password. We can also setup passwordless ssh in Linux between two Linux servers so that you don't have to en

Mount Hard Disk in Linux

In this article we will be looking at mounting external hard drive in Linux onto a directory. This can be achieved by adding a hard disk to virtual machine, formatting the disk and mounting the disk o

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis