| 65 | |
| 66 | === Target:- === |
| 67 | This defines what action needs to be done on the packet (ACCEPT,DROP,etc..) |
| 68 | === prot:- === |
| 69 | This defines the protocol (TCP,IP) of the packet. |
| 70 | |
| 71 | === source:- === |
| 72 | This tells the source address of the packet. |
| 73 | |
| 74 | === destination:- === |
| 75 | This defines the destination address of the packet |
| 76 | |
| 77 | ''' 2. Clear the rules :''' |
| 78 | If you ever want to clear/flush out all the existing rules. Run the following command:- |
| 79 | {{{ |
| 80 | sudo iptables -F |
| 81 | }}} |
| 82 | This will reset the iptables. |
| 83 | |
| 84 | '''3. Changing the default policy of chains :''' |
| 85 | {{{ |
| 86 | sudo iptables -P Chain_name Action_to_be_taken |
| 87 | }}} |
| 88 | |
| 89 | = Making your First Rule := |
| 90 | ''' 1. Implementing a DROP rule :''' |
| 91 | |
| 92 | We’ll now start building our firewall policies.We’ll first work on the input chain since that is where the incoming traffic will be sent through. |