Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: "Alex" <alex@hostingcenter.ro>
To: lartc@vger.kernel.org
Subject: [LARTC] HTB and metro+int. limits
Date: Tue, 30 Sep 2003 18:05:35 +0000	[thread overview]
Message-ID: <marc-lartc-106494528611032@msgid-missing> (raw)

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/

                 reply	other threads:[~2003-09-30 18:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-106494528611032@msgid-missing \
    --to=alex@hostingcenter.ro \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox