Modify iptables rules

October 3, 2017 in memos.

Show all iptables rules and include line numbers

iptables -L INPUT --line-numbers

Replace iptables rule at a specific line number

iptables -R X INPUT <new rule here>