|
|
ВНИМАНИЕ: Използвайте форумите на сайта за дa зададете вашите въпроси.
Въпрос |
От: Djimbo (djimbo __@__ ssi[ точка ]bg) |
Дата: 07/27/2002 |
Zdr na vsichki
molqvi za malko pomosh .Znam che za ogranichavan na skorosta
na dadena lan mreja se izpolzva tc , no vaprosat mi e tochno
kakvo da napravq che da q ogranicha.
Daytemi primerna comanda PLS
10x
|
Отговор #1 |
От: raptor |
Дата: 07/27/2002 |
ot edna dokumentaciq deto pisah nawremeto :")
The minimum required steps are :
1. Attach root QDisc to the interface
tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit
avpkt 1000 cell 8
2. Create your first class (channel)
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth
10Mbit
rate 33600 allot 1514 cell 8 weight 1 prio 5 maxburst 20
avpkt 1000 bounded
-rate is the desired bandwidth of the channel.
3. Add classiffier
tc filter add dev eth0 protocol u32 match ip dst
192.168.0.0/24 flowid 1:1
as -dst set your internal network.
One important thing to mention - in our case eth0 is the
interface that points toward your internal network and we
are creating a "download" channel. If you want to specify
two-directional channels you need to do similar thing for
eth1 interface, also in this case the filter will be "match
ip src" not "dst".
more examples (top)
Here is one example of using masquerading and ipchains
packet marking.
We have two ethernet cards one in the real network ( eth0 -
212.5.134.16 ) and the other one ( eth1 - 192.168.5.1 ) that
points to our masqueraded network 192.168.5.0/24. What we
do.
1. We are dening all packets.
2. With four ipchains rules we are marking two channels, see
the option -m. (The channel labels/handles are "1" and
"2").
3. We are dening forwarding, except for our internal
network, which is masqueraded.
4. Next add root Qdisc and our two classes.
5. Classify packets that we marked already.
Take a look at this part of the rule - handle 1 fw classid
1:1 - packet marked as "1" goes to class "1:1" with speed
33600.
Thats it.. you can see the commented similar rules based on
"u32" classifier for comparison.
ipchains -P input DENY
ipchains -A input -s 212.5.134.16 -j ACCEPT -m 1
ipchains -A input -d 212.5.134.16 -j ACCEPT -m 2
ipchains -A input -s 192.168.5.0/24 -j ACCEPT -m 1
ipchains -A input -d 192.168.5.0/24 -j ACCEPT -m 2
ipchains -P forward DENY
ipchains -A forward -s 192.168.5.0/24 -j MASQ
tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit
avpkt 1000 cell 8
tc qdisc add dev eth1 root handle 1: cbq bandwidth 10Mbit
avpkt 1000 cell 8
tc class add dev eth0 parent 1:0 classid 1:1 est 1sec 2sec
cbq bandwidth 10Mbit rate 33600 allot 1514 cell 8 weight 1
prio 5
maxburst 20 avpkt 1000 bounded
tc class add dev eth1 parent 1:0 classid 1:2 est 1sec 2sec
cbq bandwidth 10Mbit rate 19200 allot 1514 cell 8 weight 1
prio 5
maxburst 20 avpkt 1000 bounded
#tc filter add dev eth0 protocol ip u32 match ip dst
192.168.5.0/24 flowid 1:1
#tc filter add dev eth1 protocol ip u32 match ip src
192.168.5.0/24 flowid 1:1
tc filter add dev eth0 protocol ip handle 1 fw classid 1:1
tc filter add dev eth1 protocol ip handle 2 fw classid 1:2
|
<< HELP: aviplay i bg subtitri (1
) | StarOffice 6.0 FINAL cracked :) (1
) >>
|
|
|
|
|