Thursday, August 14, 2008

How To Integrate HTB-tools with Squid + ZPH (ver. 1)

I'm goin to tell you my search result @ google that i've implemented on my friend's server. It begins when my friend has asked me to integrate Squid + zph with HTB-tools in same machine.
"3 In One, no need many servers for warnet laaaah" as he said.

This time it's about Linux Ubuntu not Slackware as usual.

Illustration :

1. Internet <> Linux <> Lan

2. Linux as gateway, Proxy and Shaper server.
O/s : Ubuntu
Proxy : squid-2.7.STABLE4 with ZPH included
Limiter : HTB-Tools
Kernel : 2.6.21

3. HTB has been installed on System.

My experience begins at HTB with Squid+zph integration.

Steps :

1. Extract and Install Squid 2.7. How to install for squid 2.6 can found at here. Edit squid.conf and insert these line below.
zph_mode tos
zph_local 0x30

2. Installing HTB-tools and make your own rule to shape LAN's ip.

3. Generate htb config eg. eth1-qos.conf
root@dianseh# q_parser eth1 100000 100000 /etc/htb/eth1-qos.conf > /usr/local/bin/
root@dianseh# chmod +x /usr/local/bin/

4. Edit
----find this line---
tc qdisc add dev eth0 parent 1;0x10 handle 0x10: pfifo limit 5
----insert these line----
tc class add dev eth0 parent 1;1 classid 1;0x15 htb rate 10Mbit
tc filter add dev eth0 parent 1;0 protocol ip prio 1 u32 match ip protocol 0x6 0xff match ip tos 0x30 0xff flowid 1;15

5. Excute to starting.
6. Put it into startup script
7. Done.

Please tell me if any additional information or missconfiguration.

Good Luck

References :

1. squid + zph

No comments: