|
Re: lug-bg: BG i ne BG trafik
- Subject: Re: lug-bg: BG i ne BG trafik
- From: gf@xxxxxxxxxxx (Georgi Chorbadzhiyski)
- Date: Tue, 11 Feb 2003 12:25:42 +0200
Konstantin Ivanov wrote:
> Kak moga da ogranichavam skorosta za BG i vynshen trafik, s HTB naprimer ?
Markirai paketite koito sa za bg ip-ta i posle mozhesh da polzvash
fwmark match za da gi vkarash v klasa v koito iskash. bg mrezhite
mozhesh da izvadish ot http://ip.ludost.net/
Attachnal sam dva scripta, ediniat svalia mrezhite drugiat izpolzva
iptables za da markira paketite. S 8 se markirat vsichki paketi a
s 16 samo tezi koito sa ot bg mrezhi.
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
#!/bin/sh
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
BASE="bg_nets"
NOW=$(date +%Y-%m-%d)
wget "http://ip.ludost.net/cgi/process?country=1&country_list=bg&format_template=prefix" -q -O - | grep ^[0-9] > ${BASE}_${NOW}
if [ $? = 0 ]
then
ln -sf ${BASE}_${NOW} ${BASE}
touch bg_nets_unlisted
fi
#!/bin/sh
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
echo "Clear mangle table."
iptables -F -t mangle
iptables -A PREROUTING -t mangle -j MARK --set-mark 8
cd `dirname $0`
echo "Mark packets."
sort -n bg_nets bg_nets_unlisted | sed -e 's| .*||' | while read NET
do
iptables -A PREROUTING -t mangle -s $NET -j MARK --set-mark 16
done
============================================================================
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
============================================================================
|
|
|