|
Re: lug-bg: трафик
- Subject: Re: lug-bg: трафик
- From: Georgi Ivanov <genius@xxxxxxxxxxxxxx>
- Date: Mon, 16 Aug 2004 17:18:12 +0300
- Organization: IT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 16 August 2004 16:25, Iwan Stoqnow wrote:
> Здр,
> как да отделя международния от bg-peering трафика, например за да давам
> различна скорост на потребителите?
>
> ===========================================================================
>= A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
> http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara
> Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
> ===========================================================================
>=
маркираш адресите на потребителите с две марки едната за international
другата за peer, описваш си peer-a в скрипта за трафик контрол и прекарваш
през него съответно потребителите примерно:
това в филтъра ти примерно
IPS="/etc/tc/peer" # това са българските мрежи
iptables -t mangle -N PEERING
iptables -t mangle -N INT
iptables -t mangle -A FORWARD -j MARK --set-mark 1
# BG Peering
for i in `grep -v \# $IPS`; do
iptables -t mangle -A FORWARD -s $i -j PEERING
done
#PEERING MARK
iptables -t mangle -A PEERING -d 10.0.0.0/24 -j MARK --set-mark 10
#INTERNET mark
iptables -t mangle -A INT -d 10.0.0.0/24 -j MARK --set-mark 12
и това в трафик контрол скрипта
${TC} qdisc add dev ${DEV} root handle 1: htb
${TC} class add dev eth0 parent 1: classid 1:1 htb rate 10Mbit ceil ${CEIL}
prio 1
${TC} class add dev ${DEV} parent 1:1 classid 1:2 htb rate 128Kbit ceil
${CEIL} prio 1
#inter
${TC} class add dev ${DEV} parent 1: classid 1:3 htb rate 128Kbit ceil
128Kbit prio 0
#FW-MARK INET
${TC} filter add dev ${DEV} parent 1: protocol ip prio 1 handle 12 fw classid
1:3
${TC} qdisc add dev ${DEV} parent 1:1 sfq perturb 10
${TC} qdisc add dev ${DEV} parent 1:2 sfq perturb 10
${TC} qdisc add dev ${DEV} parent 1:3 sfq perturb 10
function users () {
for IP in $(cat $USERS | awk '{print $1}'); do
${TC} filter add dev ${DEV} protocol ip parent 1:1 prio 2 u32 \
match ip src $IP flowid 1:2
done
return 0
}
# BG Peering
for i in `grep -v \# /etc/tc/ipl0`; do # БГ мрежи
${TC} filter add dev ${DEV} protocol ip parent 1: prio 1 u32 match ip src $i
flowid 1:1
done
users
- --
Aii Data Processing
System Administrator
IT Department
Ако не отговарям на писмото виж по надолу
http://6lyokavitza.org
One OS to rule them all, One OS to find them, One OS to bring them all and in
the darkness bind them
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFBIMIn0dEkp0mjhDsRAnzuAKCKMxH8v7Y4Tc/WVgs9RDk1pUvc6ACfeV+a
RLjbMQ3ZW8YofBhgC1MUhqo=
=rOSB
-----END PGP SIGNATURE-----
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================
|
|
|