Bagaimana cara menghapus Rules Iptables

Ada kalanya Anda ingin menghapus semua rules untuk kembali membuat rules dari awal lagi. Untuk melakukannya, jalankan perintah Flush berikut ini:

sudo iptables -F

Anda juga bisa menghapus suatu rule secara spesifik dengan menggunakan perintah Delete atau -D.  Namun, Anda perlu tahu dulu nomor line dari rule yang akan Anda hapus. Jadi, jalankan perintah di bawah ini:

sudo iptables -L --line-numbers

Setelah dijalankan, Anda akan mendapat output yang mirip seperti ini:

Pilih rule yang akan dihapus, kemudian ingatlah chain serta nomornya. Masukkan chain beserta nomor rule pada perintah delete sebagai berikut:

sudo iptables -D [chain] [nomor rule]

Sebagai contoh, Anda ingin menghapus rule nomor 2 pada chain INPUT. Maka, perintahnya adalah:

sudo iptables -D INPUT 2
Was this answer helpful?

Related Articles

How to turn off the VPS?

Please Login to Mikyhost = > Click VPS Package = > Click Shut Down thanks,

How do I turn on my VPS?

Please Login to Mikyhost = > Click VPS Package = > Click Power on   thanks,

How to Reset VPS Password?

Resetting password on VPS Package Please Login at Mikyhost = > Click VPS Package = > Click...

How to Restart VPS?

How do I restart the VPS? Please Login to Mikyhost => VPS PACKAGE => CLICK REBOOT

How to reinstall/rebuild VPS

Please enter the VPS Panel and click Rebuild and select the images to be reinstalled. thanks,