Skip to contentSkip to conversation

Need some help

LARTC kinto 2 participants 2 messages May 14, 2005

lore
Share & tools
lore

kinto

author
#0 lore raw

Hi all, I have read the larc howto and I need to apply a traffic shaper with this configuration:

router / two interface etho and eth1

lan

lan is on eth1 and on eth0 I've the dsl connection (1.2 Mbit / 256 kbit)

I need to limit the bandwith towards lan and I've thought at HTB and tcng. I write the script belove. I want limit the p2p and ftp (ssh and irc) connection at 15 kBps (128 kbps) and the other type of traffic at 32 kBps (256kbps). Is the script right?
Moreover I want understand better how htb work: I can shape the traffic router->lan but I can't shape traffic lan->router, is it right? In this way I can limit the bandwidht towards lan, but I have the bandwith towards router always full.
Thanks

P.S.: sorry for my very bad english :)

############# script #########

/*
*Simply tcng traffic control file.

*/

#define INTERFACE eth1

dev INTERFACE {
                egress {

                        class( <$p2p> )
                        if tcp_sport = 4662
                        if udp_sport = 4672
                        if udp_sport = 4666
                        if tcp_sport = 6882
                        if tcp_sport = 6346

                        class ( <$ftp> )
                        if tcp_sport = 21
                        if tcp_sport = 22 || ip_tos_delay = 1
                        if tcp_sport = 6667 || tcp_dport = 7000;

                        class ( <$def> )
                        if 1 ;

                        htb () {
                                class ( rate 256kbps, ceil 256kbps ) {
                $p2p   = class ( rate  56kbps, ceil 128kbps ) { sfq; } ;
                $ftp   = class ( rate  56kbps, ceil 128kbps ) { sfq; } ;
               $def   = class ( rate  256kbps, ceil 256kbps ) { sfq; } ;
                                     }
                                }

                        }
              }

##############################

--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Digitalpix: Il metodo più comodo, veloce e conveniente
* per stampare le tue foto digitali migliori.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid23&d-5
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw

Hi..

Quoted 11 lines

Hi all, I have read the larc howto and I need to apply a traffic shaper with this configuration:

router / two interface etho and eth1

lan

lan is on eth1 and on eth0 I've the dsl connection (1.2 Mbit / 256 kbit)

Thats most common config.. (same as mine)

Quoted 10 lines

I need to limit the bandwith towards lan and I've thought at HTB and tcng. I write the script belove. I want limit the p2p and ftp (ssh and irc) connection at 15 kBps (128 kbps) and the other type of traffic at 32 kBps (256kbps). Is the script right?
Moreover I want understand better how htb work: I can shape the traffic router->lan but I can't shape traffic lan->router, is it right? In this way I can limit the bandwidht towards lan, but I have the bandwith towards router always full.

You can shape from lan to router but only In ingress qdisc what is not a good idea.
If you want prevent your lan users from uploading too much you can limit your outgoing traffic on dev eth0.

Quoted 58 lines

Thanks

P.S.: sorry for my very bad english :)

############# script #########

/*
*Simply tcng traffic control file.

*/

#define INTERFACE eth1

dev INTERFACE {
                egress {

                        class( <$p2p> )
                        if tcp_sport = 4662
                        if udp_sport = 4672
                        if udp_sport = 4666
                        if tcp_sport = 6882
                        if tcp_sport = 6346

                        class ( <$ftp> )
                        if tcp_sport = 21
                        if tcp_sport = 22 || ip_tos_delay = 1
                        if tcp_sport = 6667 || tcp_dport = 7000;

                        class ( <$def> )
                        if 1 ;

                        htb () {
                                class ( rate 256kbps, ceil 256kbps ) {
                $p2p   = class ( rate  56kbps, ceil 128kbps ) { sfq; } ;
                $ftp   = class ( rate  56kbps, ceil 128kbps ) { sfq; } ;
               $def   = class ( rate  256kbps, ceil 256kbps ) { sfq; } ;
                                     }
                                }

                        }
              }

##############################

--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Digitalpix: Il metodo piy comodo, veloce e conveniente
* per stampare le tue foto digitali migliori.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid23&d-5
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

Signature · 8 lines
Traffic shaper using iptables and tc-HTB.
Ist-shaper (http://sourceforge.net/projects/ist-shaper/)


_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc