Kebijakan Mangle Implementasi Metode PCC implementation
“
public2_conn
” akan diberi nama “
to_public2
”. Hal ini digunakan untuk penerusan paket yang ada pada kebijakan
routing.
Add chain=output
action=mark- routing
new- routing-
mark=to_public1 passthrough=no connection-mark=public1_conn
add chain=output
action=mark- routing
new- routing-
mark=to_public2 passthrough=no connection-mark=public2_conn
3. Untuk mencegah terjadi proses mangle yang menuju jaringan yang tidak ditentukan maka harus dibuat ketentuan proses trafik
paket data berasal dan akan kemana yang terkena kebijakan pada proses mangle. Berikut perintahnya:
chain=input action=mark-connection new-connection-mark=ISP-1 passthrough=yes connection-state=new in-
Interface=Local chain=input action=mark-connection new-connection-mark=ISP-2
passthrough=yes connection-state=new in- Interface=Local
chain=pre routing
action=mark-connection new-connection-
mark=ISP-1 passthrough=no in-
Interface=Local connection-mark=ISP-1 chain=pre
routing action=mark-connection
new-connection- mark=ISP-2
passthrough=no in- Interface=Local connection-mark=ISP-2
4. Untuk menetapkan aturan untuk tiap koneksi bahwa setiap trafik paket data diarahkan ke Interface proxy. Kebijakan ini
digunakan untuk proses komunikasi antar Router. Perintah nya sebagai berikut :
chain=pre routing
action=mark-connection new-connection-
mark= PROXY-1
passthrough=yes connection-state=new
dst-address- list=LocalNET in-
Interface=Proxy
chain=pre routing
action=mark-connection new-connection-
mark= PROXY-2
passthrough=yes connection-state=new
dst-address- list=LocalNET
in- Interface=Proxy
add chain=pre routing action=mark-connection new-connection-
mark= PROXY-3 passthrough=yes connection-state=new dst-
address-list=LocalNET in- Interface=Proxy
5. Tahap ini adalah tahap dilakukannya proses per-connection- classifier PCC pada proses mangle. Ada 2 proses mangel di
Interface proxy dan Interface local. Berikut perintahnya: a. Interface Local
Add chain=pre
routing action=mark-connection
new- connection-mark=Public-1
passthrough=yes dst-address-
type=local in- Interface=Local per-connection-classifier=both-
addresses-and-ports:30 Add
chain=pre routing
action=mark-connection new-
connection-mark=Public-2 passthrough=yes
dst-address- type=local in-
Interface=Local per-connection-classifier=both- addresses-and-ports:31
Add chain=pre
routing action=mark-connection
new- connection-mark=Public-3
passthrough=yes dst-address-
type=local in- Interface=Local per-connection-classifier=both-
addresses-and-ports:32
b. Interface Proxy
chain=pre routing
action=mark-connection new-connection- mark=
PROXY-1 passthrough=yes protocol=tcp dst-address- type=local dst-address-list=LocalNET in-
Interface=Proxy dst-port=80,81,8080,3128
per-connection-classifier=both- addresses-and-ports:30
chain=pre routing
action=mark-connection new-connection- mark=
PROXY-2 passthrough=yes protocol=tcp dst-address- type=local
dst-address-list=LocalNET in- Interface=Proxy
dst-port=80,81,8080,3128 per-connection-classifier=both-
addresses-and-ports:31 chain=pre
routing action=mark-connection new-connection-
mark= PROXY-3 passthrough=yes protocol=tcp dst-address-
type=local dst-address-list=LocalNET in- Interface=Proxy
dst-port=80,81,8080,3128 per-connection-classifier=both-
addresses-and-ports:32
Pada proses prerouting semua paket yang melewati Router akan diproses. Dan untuk menghindari paket yang
akan menuju ke jaringan proxy dan jaringan local agar tidak terkena proses PCC maka diberikan yang diproses dst
address type=local dimana semua paket yang diproses adalah bukan yang akan menuju jaringan local tetapi
jaringan proxy. Berikut perintahnya :
chain=pre routing
action=mark- routing
new- routing-
mark=Route- Proxy-1
passthrough=yes dst-address-list=LocalNET in-
Interface=Proxy connection-mark=PROXY-1 chain=pre
routing action=mark-
routing new-
routing- mark=Route-
Proxy-1 passthrough=yes dst-address-list=LocalNET
in- Interface=Proxy
connection-mark= PROXY-2
chain=pre routing
action=mark- routing
new- routing-
mark=Route- Proxy-2
passthrough=yes dst-address-list=LocalNET in-
Interface=Proxy connection-mark=
PROXY-3
Setelah mendapatkan hasil, kemudian PCC akan menerapkan marking pada tiap paket data dan akan
membagi trafik menjadi dua kelompok yaitu kelompok dengan marking “isp1_conn” dan kelompok dengan
marking “isp2_conn”. Selanjutnya
adalah penambahan
rule untuk
meneruskan paket yang telah di-marking pada tahap PCC untuk tiap-tiap paket yang akan meninggalkan Router.
Untuk routing yang akan dilewatkan ke ISP 1 dengan mark connection “
Public1_conn
” akan diberi routing mark “
to_public1
” dan yang akan dilewatkan ke ISP 2 dengan mark connection “
Public2_conn
” akan diberi routing mark “
to_public2
”. Hal ini digunakan untuk penerusan paket yang ada pada kebijakan routing. Berikut perintahnya :
6. Inisialisasi IP Proxy dan konfigurasi Proxy a. IP Proxy
Pada tahap ini adalah tahap konfigurasi IP pada proxy berikut perintahnya :
nano etcnetwork Interfaces
auto eth0 iface eth0 inet static
address 192.168.10.1 netmask 255.255.255.0
network 192.168.10.2
b. Konfigurasi Proxy Pada tahap ini proxy akan di konfigurasi untuk
mendapatkan hasil yang maksimal dalam proses caching. Berikut Perintahnya :
nano etcsquidsquid.conf
config ht proxy-v.4
cache_dir dan DNS di dns_name server
http_port 3128 transparent pid_
filename varrunsquid.pid cache_effective_user
proxy cache_effective_group
proxy
error_directory usrshareluscaerrorsEnglish icon_directory usrshareluscaicons
visible_hostname proxy
cache_mgr adminlocalhost access_log varlogsquidaccess.log
cache_log varlogsquidcache.log cache_store_log none
log
file_rotate 1 shutdown_lifetime 10 seconds
cache_mem 8 MB maximum_object_size_in_memory 32 KB
memory_replacement_policy heap GDSF cache_replacement_policy heap LFUDA
Adapun keterangan lain konfigurasi terdapat pada lampiran.