Wednesday, January 27, 2016
Panduan Soal Ujikom Paket 1
OS LINUX
TOPOLOGI JARINGAN
Speedy—modem(bridge)—Router+Proxy(Debian/Ubuntu Linux)—switch—klien
eth0 : menuju modem
eth1 : menuju LAN (Switch)
ROUTER
1. edit ip di linux
# pico /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.xxx
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
auto eth1
iface eth1 inet static
address 192.168.50.1
netmask 255.255.255.0
network 192.168.50.0
broadcast 192.168.50.255
2. Menambah dns
# pico /etc/resolv.conf
nameserver 222.124.204.34
nameserver 203.130.193.74
3. Lakukan ping ke 192.168.1.1, kemudian ping ke internet contoh ping www. yahoo.com, dalam hal ini server sudah bisa mengakses internet.
4. Update repository
#pico /etc/apt/sources.list
Hilangkan tanda (#) pada urutan yang kedua
#deb menjadi deb
Lalu save
5. Lakukan update repository
# apt-get update
Masukan cd lalu Enter
6. Proses NAT
Langkah-langkahnya:
#pico /etc/sysctl.conf
hilangkan tanda (#) pada baris
net.ipv4.ip_forward=1
7. Setting iptables
# iptables -t nat -A POSTROUTING -s 192.168.50.0/24 –d 0/0 -j MASQUERADE
8. simpan konfigurasi iptables pada directory local
# pico /etc/rc.local
Lalu ketik lagi:
# iptables -t nat -A POSTROUTING -s 192.168.50.0/24 –d 0/0 -j MASQUERADE
Lalu save dan reboot
9. Setting Client
IP : 192.168.50.xxx
Netmask : 255.255.255.0
Gateway : 192.168.50.1
DNS : 222.124.204.34
203.130.193.74
SETTING PROXY DAN BLOCKING SITE
1. MASUKAN CD LINUX
2. INSTAL SQUID
1. #apt-get install squid
2. #cd /etc/squid
3. #cp squid.conf squid.conf.backup (memback-up file squid.conf, untuk lihat hasilnya ketik ls)
3. EDIT FILE SQUID
1. #pico /etc/squid/squid.conf
2. Cari http_port 3128 (bisa dicari dengan menggunakan ctrl+w kemudian ketikan http_port) Kemudian edit menjadi : http_port 3128 transparent
3. Cari : acl connect (bisa dengan menggunakan ctrl+w kemudian ketikan acl CONNECT)
4. Cari : acl CONNECT method CONNECT
5. Ketikan dibawahnya : acl blokir dstdomain “etc/squid/blokir.txt”
acl lan src 192.168.50.0/24
http_access deny blokir
http_access allow lan
http_access allow all
kemudian save
6. Cari : hostname (bisa dengan menggunakan ctrl+w kemudian ketikan hostname)
Cari : visible_hostname
Cari : #default
Ketikan/edit dibawahnya menjadi : visible_hostname sekolah.sch.id
7. Cari webmaster (bisa dengan menggunakan ctrl+w kemudian ketikan webmaster)
Cari : #default
Ketikan/edit dibawahnya menjadi: cache_mgr nama@sekolah.sch.id
8. Untuk menambah memori cache
Ctrl+w, ketikan cache_mem
Cari : #default
Edit menjadi : cache_mem 32_MB
9. Save (ctrl+x kemudian tekan y kemudian enter)
4. BLOKIR
#pico /etc/squid/blokir.txt
Ketikan :
www.youtube.com
www.facebook.com
5. FIREWALL
1. #iptables –t nat –A PREROUTING –p tcp --dport 80 –i eth1 –j REDIRECT --to-port 3128
2. #pico /etc/rc.local
di bawah # iptables -t nat -A POSTROUTING -s 192.168.50.0/24 –d 0/0 -j MASQUERADE
ketikan lagi:
#iptables –t nat –A PREROUTING –p tcp --dport 80 –i eth1 –j REDIRECT --to-port 3128
Exit 0
3. Save dan reboot
4. Cek
#iptables –t nat –L (sampai terlihat hasilnya)
KONFIGURASI ROUTER
KONFIGURASI ROUTER
#nano /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
dns_namesevers 7.7.7.1
save
#/etc/init.d/networking restart
#nano /etc/rc.local
diatas exit 0 tambah
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 –j MASQUERADE
save
#/etc/init.d/rc.local stop
#/etc/init.d/rc.local start
#iptables –L –t nat
#apt-get install squid squid-common
#nano /etc/squid/squid.conf
ctrl w
http_port 3128
tambahkan :http_port 3128 transparent
ctrl w
icp_port 3
hapus pagar icp_port 3130
ctrl w
cache_mem 8
hapus pagar cache_mem 8 MB
ctrl w
cache_mgr
hapus #
cache_mgr webmaster : email kamu (bonekbrutal86@yahoo.com)
ctrl w
acl all src
dibawah acl to_localhost tambah :
acl user src 192.168.1..0/24
acl domain dstdomain "/etc/squid/block
ctrl w
http_access
dibawah #default
#http_access deny all
tambahin :
http_access deny domain
http_access allow user
save
#nano /etc/rc.local
diatas exit 0 tambah
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
save
#/etc/init.d/rc.local stop
#/etc/init.d/rc.local start
#iptables –L –t nat
#nano /etc/squid/block
Masukan situs yang akan di blok
Contoh:
www.facebook.com
www.youtube.com
save
#squid –z
#/etc/init.d/squid restart
Subscribe to:
Posts (Atom)