Konfigurasi Router Linux

Konfigurasi Router (linux)

*ROUTER*
#pico /etc/network/interfaces
auto eth0                                                        auto eth1
iface eth0 inet static                                        iface eth1 inet static
  address 192.168.10.9                                      address 192.168.50.1
  netmask 255.255.255.0                                   netmask 255.255.255.0
  network 192.168.10.0
  gateway 192.168.1.1
#/etc/init.d/networking restart                                     Note: *ifconfig eth0/eth1
#pico /resolv.conf                                                                  *ifup eth0/eth1
Nameserver 192.168.10.9
Nameserver 202.134.0.155
Nameserver 8.8.8.8
#pico/etc/sysctl.conf
Hapus tanda pagar (#) pada script net.ipv4.ip_forward=1  
#echo 1 > /proc/sys/net/ipv4_forward
#route add default gw 192.16.50.1
#iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE  
#pico /etc/rc.local
            iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE 
#iptables-save
#reboot
*PEMBLOKIRAN SITUS*
#apt-get install squid
#pico /etc/rc.local
            iptables –t nat –A PREROUTING –i eth1 –p tcp - -dport 80 –j REDIRECT
- -to –port 3128
#iptables-save
#pico /etc/squid/squid.conf
CTRL+W:
                        http_port 3128 à http_port 3128 transparent
                        cache_mgr à cache_mgr admin@smk.com
                        visible_hostname à visible_hostname proxy.smk.com
                        cache_mem à cache_mem 16 MB
acl connect :
            Ada 3 ip yang berada di bawah sendiri, di ubah menjadi 192.168.0/24 (tanpa tanda #) sedangkan pada ip yang lain, berikan tanda #.
Dibawah acl connect to connect ketikan :
acl blockaccess dst domain “/etc/squid/blockaccess.txt”
Beri tanda # pada deny all 
KEMUDIAN KETIKAN DIBAWAHNYA:
            http_access deny blockaccess
            http_access allow localnet
#pico /etc/squid/blockaccess.txt
            MISAL: www.facebook.com
               www.youtube.com
#/etc/init.d/squid restart
#reboot

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar: