Install RH9 on 192.168.88.55, the kernel version is
2.4.20
-8, download http://www.linux-ip.net/traft-control/iproute-2.4.7-7.i386.rpm, execute rpm-fer iproute-2.4.7-7.i386.rpm, TC Install it to / sbin / path.
TC requires the kernel support, the kernel file should be as follows:
#
# Qos and / or fair queueing
#
Config_net_sched = y
Config_netLink = Y
Config_rtnetLink = Y
CONFIG_NET_SCH_CBQ = Y
CONFIG_NET_SCH_CSZ = Y
CONFIG_NET_SCH_PRIO = Y
CONFIG_NET_SCH_RED = Y
Config_net_sch_sfq = Y
CONFIG_NET_SCH_TEQL = Y
CONFIG_NET_SCH_TBF = Y
CONFIG_NET_SCH_GRED = Y
CONFIG_NET_SCH_DSMARK = Y
Config_net_sch_ingress = y
Config_net_qos = y
Config_net_estimator = y
CONFIG_NET_CLS = Y Y
CONFIG_NET_CLS_TCINDEX = Y
CONFIG_NET_CLS_ROUTE4 = Y
CONFIG_NET_CLS_ROUTE = Y
CONFIG_NET_CLS_FW = Y
CONFIG_NET_CLS_U32 = Y
CONFIG_NET_CLS_RSVP = Y
CONFIG_NET_CLS_RSVP6 = Y
CONFIG_NET_CLS_POLICE = Y
After Make MenuConfig, choose Networking Options --à to choose QoS .... ---> Make sure this part is selected *
The server side is installed in FTPD and there is /Home/tangp/fw3/packages.tgz file,
Execute: ls -l packages.tgz
Display: -rw-r - r - 1 root root 43001096 9 â 15 15:01 packages.tgz
Perform:
Get packages.tgz
display:
200 Port Command Successful. Consider Using Pasv.
150 Opening Binary Mode Data Connection for Packages.tgz (43001096 Bytes).
226 File Send OK.
FTP: 43001096 BYtes Received in 3.73seconds 11513.01kBytes / sec.
Execute at the server:
/ SBIN / TC QDISC DEL DEV Eth0 Root Handle 10:
/ sbin / tc qdisc add dev eth0 root handle 10: 0 CBQ Bandwidth 10Mbit Avpkt 10000
/ SBIN / TC Class Add dev eth0 Parent 10: 0 ClassID 10: 1 CBQ Bandwidth 10Mbit Rate 10Mbit Allot 1514 Avpkt 10000
/ sbin / tc class add dev eth0 Parent 10: 1 ClassID 10: 100 CBQ Bandwidth 10Mbit Rate 8Mbit Avpkt 10000 Bounded / SBIN / TC QDISC Add dev eth0 Parent 10: 100 SFQ Quantum 1514B Perturb 15
/ sbin / tc filter add dev eth0 Parent 10: 0 Protocol IP PRIO 100 U32 Match IP DST 192.168.88.50 FlowID 10: 100
Perform:
Get packages.tgz
display:
200 Port Command Successful. Consider Using Pasv.
150 Opening Binary Mode Data Connection for Packages.tgz (43001096 Bytes).
226 File Send OK.
FTP: 43001096 BYtes Received in 18.56seconds 2317.24kBytes / sec.
It can be seen that TC does have a role, but it is not accurate.
Other tests:
1) The simplest addition method:
/ sbin / tc qdisc add dev eth0 root handle 10: HTB
/ SBIN / TC Class Add dev eth0 Parent 10: 0 ClassID 10: 100 HTB Rate 20Mbit (20000Kbps)
/ sbin / tc filter add dev eth0 Parent 10: 0 Protocol IP PRIO 2 U32 Match IP DST 192.168.88.51 FlowID 10: 100
Only three lines, add success. The usage of HTB below:
Class Add ... HTB Rate R1 Burst B1 [PRIO P] [Slot S] [PSLOT PS] [CEIL R2] [CBurst B2] [MTU MTU] [Quantum Q]
Default Minor ID of Class to Which Unclassified Packets Are Sent {0}
R2Q Drr Quantums Are Comput As Rate In BPS / R2Q {10}
Debug String of 16 NumBers Each 0-3 {0}
Rate Rate Allocated to this Class (Class Can Still Borrow)
Burst Max bytes Burst Which Can Be Accumulated During iDle Period {Compute}
CEIL Definite Upper Class Rate (no borrows) {rate}
Cburst Burst But for Ceil {computed}
MTU Max Packet Size We create rate map for {1600}
PRIO PRIORITY OF LEAF; LOWER Are Served First {0}
Quantum how much bytes to serve from leaf at onCE {USE R2Q}
2) Test display. carried out
/ sbin / tc qdisc show
/ sbin / tc class show
/ SBIN / TC Filter show
There is no available result, so put the above commands in the configuration file, display the bandwidth that has been divided by the above profile.
3) Test handle name. Execution / SBIN / TC QDISC Add Dev Eth0 Root Handle 11: HTB
/ SBIN / TC Class Add dev eth0 Parent 11: 0 ClassID 11: 100 HTB Rate 20Mbit
/ sbin / tc filter add dev eth0 Parent 11: 0 Protocol IP PRIO 2 U32 Match IP DST 192.168.88.51 FlowID 11: 100
In this way, each network card can have its own handle name, such as LAN1 called 11, Lan2 called 12, Wan1 called 21, DMZ1 called 31
4) Test network segment. carried out
/ sbin / tc qdisc add dev eth0 root handle 10: HTB
/ SBIN / TC Class Add dev eth0 Parent 10: 0 ClassID 10: 100 HTB Rate 20Mbit (20000Kbps)
/ sbin / tc filter add dev eth0 Parent 10: 0 Protocol IP PRIO 2 U32 Match IP DST 192.168.88.0/24 FlowID 10: 100
It can be seen that the target address can be a network segment J
5) Test port. carried out
/ SBIN / TC QDISC DEL DEV Eth0 Root Handle 10:
/ sbin / tc qdisc add dev eth0 root handle 10: HTB
/ SBIN / TC Class Add dev eth0 Parent 10: ClassID 10: 100 HTB Rate 2000kbps
/ sbin / tc filter address 10: 0 PRIO 1 U32 Match IP Sport 20 0xffff Flowid 10: 100
success
6) Do a super test! ! ! ! carried out:
/ SBIN / TC QDISC DEL DEV Eth0 Root Handle 10:
/ sbin / tc qdisc add dev eth0 root handle 10: HTB
/ SBIN / TC Class Add dev eth0 Parent 10: ClassID 10: 100 HTB Rate 2000kbps
/ sbin / tc filter address 10: 0 Protocol IP Parent 10: 0 PRIO 1 U32 Match IP SRC 192.168.88.5 Match IP Sport 20 0xffff Match IP DST 192.168.88.51 Match IP Protocol 6 0xFF Flowid 10: 100
The meaning is from 192.168.88.5 to 192.168.88.51 and the port is a TCP package of 20 (FTP transport port), followed by 10: 100 rules. The test is successful! !