Skip to main content
edited tags
Link
Chris Davies
  • 128.2k
  • 16
  • 179
  • 324
deleted 4 characters in body
Source Link
Chris Davies
  • 128.2k
  • 16
  • 179
  • 324

I am restricting the traffic to specific port number using the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j DROP"DROP

After sometime i want to allow traffic, so adding the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j ACCEPT”ACCEPT

Is it correct or i have to delete the first rule before adding the second. if i dont delete the first rule,both rules are present in the INPUT chain. so which one is considered ? This is in CentOS7, Looking forward for your advise.

I am restricting the traffic to specific port number using the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j DROP"

After sometime i want to allow traffic, so adding the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j ACCEPT”

Is it correct or i have to delete the first rule before adding the second. if i dont delete the first rule,both rules are present in the INPUT chain. so which one is considered ? This is in CentOS7, Looking forward for your advise.

I am restricting the traffic to specific port number using the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j DROP

After sometime i want to allow traffic, so adding the below firewall rule.

   /sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j ACCEPT

Is it correct or i have to delete the first rule before adding the second. if i dont delete the first rule,both rules are present in the INPUT chain. so which one is considered ? This is in CentOS7, Looking forward for your advise.

Source Link

Which firewall rule is considered if i 'drop' first then later adding 'accept' rule. drop or accept?

I am restricting the traffic to specific port number using the below firewall rule.

   “/sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j DROP"

After sometime i want to allow traffic, so adding the below firewall rule.

   “/sbin/iptables -A INPUT -p tcp --destination-port <port_num> -j ACCEPT”

Is it correct or i have to delete the first rule before adding the second. if i dont delete the first rule,both rules are present in the INPUT chain. so which one is considered ? This is in CentOS7, Looking forward for your advise.