pada dasarnya iptables akan hilang setelah restart, jika tidak disimpan secara permanen makan konfigurasi akan hilang, berikut cara untuk menyimpan konfigurasi ip tables agar tidak hilang
- menyimpan konfigurasi dan diload pada /etc/rc.local
- memakai iptables persistent
1. menyimpan di /etc/rc.local
IPv4
Debian/Ubuntu: iptables-save > /etc/iptables/rules.v4
RHEL/CentOS: iptables-save > /etc/sysconfig/iptables
IPv6
Debian/Ubuntu: ip6tables-save > /etc/iptables/rules.v6
RHEL/CentOS: ip6tables-save > /etc/sysconfig/ip6tables
dapat diload dengan perintah
untuk IPv4 ( iptables-restore )
Debian/Ubuntu: iptables-restore < /etc/iptables/rules.v4
RHEL/CentOS: iptables-restore < /etc/sysconfig/iptables
2. mengunakan iptables persistent
berikut cara menyimpan konfigurasi IP TABLES , kita install iptables persistent , sejak Ubuntu 10.04 LTS (Lucid) dan Debian 6.0 (Squeeze) sudah otomatis terinstall paket iptables persistent
jika belum terinstal , instal dulu dengan cara apt-get install iptables-persistent setelah terinstal, untuk menyimpan konfigurasi iptables saat ini untuk ipv4: iptables-save > /etc/iptables/rules.v4 jika menggunkan debian 6 squeeze dengan kernel 2.6.32 iptables-save > /etc/iptables/rules</pre> untuk ipv 6: ip6tables-save > /etc/iptables/rules.v6
semoga berguna
referensi
- http://stackoverflow.com/questions/9330694/how-to-permanently-update-iptables
- http://www.microhowto.info/howto/make_the_configuration_of_iptables_persistent_on_debian.html
- http://zertrin.org/projects/iptables-persistent/
- https://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently
- http://unix.stackexchange.com/questions/52376/why-do-iptables-rules-disappear-when-restarting-my-debian-system
- https://www.digitalocean.com/community/questions/how-to-close-iptables-and-reboot-iptables-on-debian-wheezy
tinggalkan pesan