Konfigurasi
Router & Firewall Debian
1. Memasukkan IP di interfaces (eth)
dengan
perintah
#nano /etc/network/interfaces
kemudian
edit filenya menjadi sebagai berikut:
auto eth0
iface eth0 inet static
address 20.20.20.5
netmask 255.255.255.192
network 20.20.20.0
broadcast 20.20.20.63
gateway 20.20.20.62
dns-nameservers
203.130.193.74
auto eth1
iface eth1 inet static
address 192.168.5.129
netmask 255.255.255.248
network 192.168.5.128
broadcast 192.168.5.135
gateway 192.168.5.130
auto eth2
iface eth2 inet static
address 126.127.5.65
netmask 255.255.255.240
network 126.127.5.64
broadcast 126.127.5.79
2. kemudian kita edit file rc.local
(digunakan
untuk melukan routing walaupun di restart)dengan perintah
#nano /etc/rc.local
sebelum
baris exit 0 ditambahkan
iptables -t nat -A POSTROUTING -j MASQUERADE
route add default dev eth0
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables
-A INPUT -i lo -j ACCEPT
iptables
-A INPUT -p tcp --dport 53 -i eth0 -j
ACCEPT {membuka koneksi port DNS}
iptables
-A INPUT -p tcp --dport 21 -i eth0 -j
ACCEPT {membuka koneksi port port FTP}
iptables
-A INPUT -p tcp --dport 22 -i eth0 -j
ACCEPT {membuka koneksi port port SSH}
iptables
-A INPUT -p tcp --dport 25 -i eth0 -j
ACCEPT {membuka koneksi port SMTP}
iptables
-A INPUT -p tcp --dport 80 -i eth0 -j
ACCEPT {membuka koneksi port port HTTP}
iptables
-A INPUT -p tcp --dport 110 -i eth0 -j
ACCEPT {membuka koneksi port POP}
iptables
-A INPUT -p tcp --dport 143 -i eth0 -j
ACCEPT {IMAP}
iptables
-A INPUT -p tcp --dport 3128 -i eth0 -j
ACCEPT {port proxy}
iptables–t nat –A PREROUTING
–p tcp –m tcp --dport 80 –j REDIRECT –to-port 3128 {jika squid ud di install}
3. Aktifkan ip forward dengan perintah
#nano /etc/sysctl.conf
cari
kata #net.ipv4.ip_forward=1 kemudian hilangkan tanda #
4. nano
/etc/resolv.conf
nameserver
20.20.20.62
nameserver 203.130.193.74
nameserver 8.8.8.8
4. Restart network perintah
#/etc/init.d/networking restart
#/etc/init.d/rc.local start
5. reboot (restart) komputer
Post a Comment