<div dir="ltr"><div><div><snip><br>> The problem I am having is, adding the new information to the existing<br>> iptables rules in /etc/sysconfig/iptables. I want to write my rules to<br>> a separate file and then tell /etc/sysconfig/iptables to include it at<br>> the correct position.<br>><br>> I read the iptables(8), iptables-save(8) and iptables-restore(8) man<br>> pages, but I don't see how to combine the different sources.<br>><br>> How do I tell iptables to include a second external source at a<br>> specific location?<br></div><snip></div><div><br></div><div></div><div><div><div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">1 - Get the iptables rules list with the line numbers enabled<br>     $ iptables -nL –line-numbers<br><br>2 - Look up the line number you want to use and insert your rule.<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">     ( I am inserting a rule at line number 10, the existing rule will shift down)<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">     $ sudo /sbin/iptables -I INPUT 10 -s 202.54.1.1 -j DROP -m comment --comment "DROP spam IP address - "<br><br>3 - Save the rules to a file in etc so you can reload them at the next reboot<br>     $ sudo /sbin/iptables-save > /etc/iptables.local<br><br>4 - To make the rules persistent, add the following rule to your /etc/rc.local file)<br>     sudo /sbin/iptables-restore < /etc/iptables.local</span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">If your system reboots you will not loose the rules now. <br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Aruna<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif"></span><br></span></div><div><span style="font-family:monospace"> <br></span></div><div><span style="font-family:monospace"> <br><br> </span></div></div></div></div></div>