materi konfigurasi linux debian
TRANSCRIPT
Materi Konfigurasi Linux Debian
1. Setting IP Address
Setting IP address di Linux DebianContoh:ETH0
IP : 192.168.1.10Netmask : 255.255.255.0Gateway : 192.168.1.1
ETH1IP : 192.168.5.1Netmask : 255.255.255.0
Edit file /etc/network/interfaces
auto eth0iface eth0 inet static
address 192.168.1.10netmask 255.255.255.0network 192.168.1.0broadcast 192.168.1.255gateway 192.168.1.1
auto eth1iface eth1 inet static
address 192.168.5.1netmaks 255.255.255.0network 192.168.5.0broadcast 192.168.5.255
2. Setting Router Debian
Edit File /etc/sysctl.conf baris ke 26#net.ipv4.ip_forward=1Hilangkan tanda “#” sehingga menjadinet.ipv4.ip_fordward=1
Edit File /etc/rc.localSebelum exit0 tambahkaniptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Restart Router
root@DskyMC:~# reboot
3. Setting DHCP Server DebianInstall paket DHCP Server di Debianroot@DskyMC:~# apt-get install dhcp3-serverLanjutkan proses instalasi…….Configurasi DHCP ServerEdit file /etc/dhcp3/dhcpd.confroot@DskyMC:~# nano /etc/dhcp3/dhcpd.confbaris 17 dan 18 tambahkan # di awal config sehingga menjadi#option domain-name "example.org";#option domain-name-servers ns1.example.org, ns2.example.org;
Lalu konfignya dari baris 54 sampai 62 ( sesuaikan dengan IP eth1 )subnet 192.168.5.0 netmask 255.255.255.0 {range 192.168.5.1 192.168.5.254;option domain-name-servers 202.134.1.10;option domain-name "smkn2mdo.net";option routers 192.168.5.1;option broadcast-address 192.168.5.255;default-lease-time 600;max-lease-time 7200;}
Edit file /etc/default/dhcp3-serverDi baris 11 INTERFACES=""Tambahkan ethernet anda di dalam tanda 2 petik sehingga menjadiINTERFACES="eth1"
Reboot Routerroot@DskyMC:~# reboot
4. Setting Proxy DebianInstall paket Squid Proxyroot@DskyMC:~# apt-get install squidLanjutkan Proses Instalasi…..Configurasi proxy squidEdit file /etc/squid/squid.confroot@DskyMC:~# nano /etc/squid/squid.confkemudian cari tulisan acl CONNECT method CONNECT Tambah teks dbawah ini di dalam file squid.conf dibawahx acl CONNECT method CONNECTacl sex dstdom_regex “/etc/sex”acl lan src 192.168.2.0/24http_access deny sexhttp_access allow lanhttp_access allow all
- tambahkan teks diatas, di bawahx acl CONNECT dalam “/etc/squid/squid.conf”lalu save
kemudiancari dan tambahkan+ ( hilangkan tanda # )http_port 3128 transparent -> port default proxy => yg transparent baru ditambahkan ( harus dtambah teks transparent )
cache_mem 16 mbcache_dir ufs /var/spool/squid 500 16 256cache_mgr [email protected]_hostname proxy.smkn2mdo.netauth_param basic children 5auth_param basic realm Squid proxy-caching web serverauth_param basic credentialsttl 2 hoursauth_param basic casesensitive off-kemudian buat folder dengan sex di “/etc”
-lalu isikan situs yang ingin diblok didalam folder sexContohnya :-www.facebook.com-www.google.com-www.debian.org
# buat ngeblok domainacl blockeddomain dstdom_regex “/etc/squid/blockeddomain.txt”http_access deny blockeddomain
# buat ngeblok url yang ada kata tertentuacl blockedstring url_regex “/etc/squid/blockedstring.txt”http_access deny blockedstringcontoh isi blockeddomain.txt—-gator.comlop.comasexvideo.complayboy.com—-contoh isi blockedstring.txt—–dialer.exeloader.exelivesexcams.exeFree_Sex_Download.exe
Setelah semua telah dsetting kemudian restart squid dengan cara : #/etc/init.d/squid restart
Kemudian edit file di /etc/rc.localtambahkan teks ini setelah iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables –t nat -A PREROUTING -s 192.168.5.0/24 -p tcp –dport 80 -j REDIRECT –to-port 3128
reboot routerroot@DskyMC:~# reboot
FINISH