Menghapus Satu Baris Rule pada iptables

Tags: April 28, 2012 10:04 AM

Salah satu cara yang dapat digunakan untuk menghapus sebuah rule di iptables.

## list terlebih dulu daftar rule beserta nomor barisnya
# iptables -L INPUT -n --line-numbers
Chain INPUT (policy DROP)
num  target     prot opt source               destination         
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
3    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:443 
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22 
5    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED

## hapus rule berdasarkan nomor baris
# iptables -D INPUT 4
# iptables -L -n --line-numbers
num  target     prot opt source               destination         
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
3    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:443 
4    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
Referensi:

Share on Facebook Twitter

1 comments:

Ivy P said...

Great post thaank you

Post a Comment