Konfigurasi firewall Iptables Rules

Berikut ini beberapa contoh rules IPTables:

server:/# iptables -F                                                   à flush tabel filter
server:/# iptables -t nat -F                                         à flush tabel nat
server:/# iptables -P INPUT ACCEPT                   à Set policy ACCEPT chain INPUT
server:/# iptables -P OUTPUT ACCEPT               à Set policy ACCEPT chain OUTPUT
server:/# iptables -P FORWARD ACCEPT          à Set policy ACCEPT chain FORWARD
server:/# iptables-save > /etc/iptables-kosong          à Simpan ke /etc/iptables-kosong

Saat dibutuhkan kondisi “kosong” tanpa filter, maka lakukan restore dari file /etc/iptables-kosong : server # iptables-restore < /etc/iptables-kosong

Contoh rules / aturan masquerade atau IP Forwarding pada Debian Lenny:

server:/# # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

è Tapi settingan iptables tersebut  hanya sementara,saat reboot akan hilang
è Cara agar Permanen :
a.       Forwarding
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

b.      Simpan kefile mana saja, misal :  /etc/iptables.rules
#iptables-save > /etc/iptables.rules

c.       Edit / Tambahkan di baris paling bawah  /etc/network/interfaces :
pre-up  iptables-restore < /etc/iptables.rules
post-down  iptables-save > /etc/iptables.rules

Next Tutorial :
1.      Windows XP SP2 and Debian Lenny 5.0.3 Installation
2.      Sharing files in Windows XP SP2 & Debian Lenny 5.03
3.      Debian Firewall Plus [more]

Tidak ada komentar:

Posting Komentar