* [LARTC] HTB and metro+int. limits
@ 2003-09-30 18:05 Alex
0 siblings, 0 replies; only message in thread
From: Alex @ 2003-09-30 18:05 UTC (permalink / raw)
To: lartc
Hello,
I need to setup HTB to limit the bandwidth, but I need to have 2 types of
limits, because my ISP gives me more bandwith for sites located in my
country, than others located outside. I have setup the following script in
which I mark packets with mark 6 for the ip clasess for the sites in my
country. What I don't know is how to continue the script with assigning
lower limits to everything else not going from ip's in --set-mark 6.
Maybe some of can enlighten me about this.
Thanks,
Alex
#!/bin/sh
#Mark metro packets
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.152.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.119.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.117.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.118.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.116.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.154.126.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.157.176.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.157.117.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.157.126.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 80.97.173.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 82.137.58.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 82.137.56.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 81.196.96.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 81.196.97.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 62.231.74.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 213.157.176.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 192.226.30.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 193.231.7.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 192.129.4.0/24 -j
MARK --set-mark 6
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 193.231.15.0/24 -j
MARK --set-mark 6
#end metro
#
#2. Anything else
/sbin/iptables -t mangle -A PREROUTING -i eth2 -d 0/0 -j MARK --set-mark 5
/sbin/tc qdisc del dev eth2 root
echo "Deleted old root disk on eth2"
/sbin/tc qdisc add dev eth2 root handle 1: htb default 10
/sbin/tc class add dev eth2 parent 1: classid 1:1 htb rate 10M
#metro
/sbin/tc class add dev eth2 parent 1:1 classid 1:10 htb rate 10M
/sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 6 flowid
1:10
#international
/sbin/tc class add dev eth2 parent 1:1 classid 1:2 htb rate 10M
/sbin/tc filter add dev eth2 protocol ip parent 1:10 prio 3 handle 5 flowid
1:2
/sbin/tc class add dev eth2 parent 1:1 classid 1:11 htb rate 50kbit ceil
100kbit prio 5
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst
192.168.254.10 flowid 1:11
/sbin/tc class add dev eth2 parent 1:1 classid 1:12 htb rate 50kbit ceil
100kbit prio 5
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst
192.168.254.11 flowid 1:12
/sbin/tc class add dev eth2 parent 1:1 classid 1:13 htb rate 50kbit ceil
100kbit prio 5
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst
192.168.254.12 flowid 1:13
/sbin/tc class add dev eth2 parent 1:1 classid 1:14 htb rate 50kbit ceil
100kbit prio 5
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 5 u32 match ip dst
192.168.254.13 flowid 1:14
.... etc
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-30 18:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-30 18:05 [LARTC] HTB and metro+int. limits Alex
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox