IPtables Installation And Configuration-failed

I think, if I click on someone review ( when I have not found anyone comments as for the solution) . I know after accepting anyone reviews task will be available to work again,

Bit I think I will not have complete marks. :slight_smile:

if you can mark it pending? @player001

@bilalshakir41396 when you do a task again, you will receive all points if you do it successfully.

@Nasri

I received 50 percents marks only on success. :slight_smile:

@Devops
Would you please explain why we should not use -A flag and what is wrong with that?

I really got stack in this task, I have run the following commands but did not work.
iptables -A INPUT -p tcp --dport=6400 -s 172.16.238.14 -j ACCEPT
iptables -A INPUT -p tcp --dport 6400 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

Am I right ? the reason is -A append the rule to the end of iptables file whereas -I insert into the first line

@Nasri

By Default, when you install iptables or firewalled, only ssh service is allowed as you notice in this task. Also, iptables applying rules as โ€œfirst matchโ€. So, if you use -A flag, iptables insert this rule at the end of current default rules and the task will fail. You can insert/delete iptables rules at specific location by using line numbers. For example, if current default rules are 7, then you can insert/delete rule at line 4.

1 Like

For tutorial/solution - https://youtu.be/oW2UTb-Nfx0 - This video is made by me with sole intention of helping the community

For Tutorial/Solution - Content made for sole reason to help the community.