Konfigurasi Router & Proxy pada LINUX Ubuntu

Konfigurasi Router

1. sudo su
2. ifconfig
3. nano /etc/network/interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.1.6
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-server 192.168.1.1

    auto eth1
    iface eth1 inet static
        address 192.168.2.9
        netmask 255.255.255.0
        network 192.168.2.0

4. /etc/init.d/networking restart
5. nano /etc/sysctl.conf
    hapus tanda #
    -net.ipv4.dealfut_filter=1
    -net.ipv4.all.rp_filter=1
6. sysctl -p
7. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    jika ada tulisan "MASQUERADE all -- 0.0.0.0/0.0.0.0" berhasil
8. iptables -t nat -n -L
9. iptables-save > /etc/network/iptables
10. nano /etc/network/iptables
11. nano /etc/init.d/rc.local
    tambahkan kata-kata di bawah esec
    iptables-restore < /etc/network/iptables
12. /etc/init.d/rc.local start
13. reboot

Konfigurasi Proxy Router

1. ifconfig
2. apt-get update
3. apt-get install squid
4. cp /etc/squid/squid.conf /etc/squid/squid.conf.backup
5. rm /etc/squid/squid.conf
6. nano /etc/squid/squid.conf
    acl all src all
    acl localnet src 192.168.0.0/24
    acl situs url_regex -i "/etc/squid/blokir.txt"
    http_access deny situs
    http_access allow localnet
    http_port 3128 transparent
    cache_mem 8 mb
    memory_replacement_policy heap GDSF
    cache_replacement_policy heap LFUDA
    store_dir aufs /cache 10000 24 256
    cache_store_log none
    cache_access_log /var/log/squid/access.log
    cache_effective_user proxy
    cache_effective_group proxy
    visible_hostname proxy.www.smkvinama2.sch.id
    cache_mgr admin@smkvinama2.sch.id
7. nano /etc/squid/blokir.txt
    www.facebook.com
    www.youtube.com
8. mkdir /cache
9. chown -R proxy:proxy /etc/squid/blokir.txt
10. chown -R proxy:proxy /cache
11. service squid stop
12. squid -z
13. service squid start
14. iptables -t nat -I PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
15. iptables -t nat -I PREROUTING -i eth0 -p udp -m udp --dport 80 -j REDIRECT --to-ports 3128
16. iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.6:3128
17. iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
18. iptables-save > /etc/network/iptables

0 komentar:

Posting Komentar

 
~=EXECY BLOG=~ © 2012 | Designed by Cheap TVS, in collaboration with Vegan Breakfast, Royalty Free Images and Live Cricket Score