> ## Content Index
> Fetch the complete content index at: https://kudithipudi.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# HOW TO : Modify iptables rules
- URL: https://kudithipudi.org/how-to-modify-iptables-rules/
- Published: 2011-12-12T20:17:16.000Z
- Updated: 2011-12-12T20:17:16.000Z
- Description: Quick how to for my personal records. iptables is an open source firewall (and it does a lot more) included with most linux distributions. Steps to...
- Author: admin
- Tags: HOWTO, Linux, Networking, security, Uncategorized, #wp, #wp-post, #Import 2026-08-23 02:32

Quick how to for my personal records. [iptables](http://en.wikipedia.org/wiki/Iptables?ref=kudithipudi.org) is an open source firewall (and it does a lot more) included with most linux distributions.

Steps to add new rule to existing configuration

- Check the list of rules and their corresponding sequence

```
sudo iptables -vL –line-numbers
```

- Add the new rule at the required location/sequence

```
sudo iptables -I INPUT LINE_NUMBER RULE
```

Example :

```
iptables -I INPUT 8 -s X.X.X.X/24 -p tcp -m state –state NEW -m tcp –dport 3128 -j ACCEPT
```

- Save the configuration

```
sudo serivce iptables save
```

Thx to Sijis for helping with the commands.