Re: [LARTC] link redundancy...

2004-04-09 Thread Peter Salanki
That could be done with a simple shell script, just pinging and switching if host 
doesn't respond. Otherwise u could use something more complex such as BGP, but I 
really don't think your ADSL provider allows yo to ibgp peer with them :/

On Fri, 9 Apr 2004 16:19:03 -0300
"Cristiano Soares" <[EMAIL PROTECTED]> wrote:

> Does anyone know how to make a link redundancy? I have two ADSL lines, and i want 
> the linux machine to be able to switch between the two lines everytime the first 
> ADSL line goes down. Thanks a lot.
> 
> Cristiano
> 




___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] link redundancy...

2004-04-09 Thread Paolo Alexis Falcone
On Fri, Apr 09, 2004 at 04:19:03PM -0300, Cristiano Soares wrote:
>Does anyone know how to make a link redundancy? I have two ADSL lines, and
>i want the linux machine to be able to switch between the two lines
>everytime the first ADSL line goes down. Thanks a lot.
> 
>Cristiano

You'll need BGP4 support for this. GNU Zebra[1] may help you here.


[1] www.zebra.org

-- 


Paolo Alexis Falcone
[EMAIL PROTECTED]
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] HTB

2004-04-09 Thread Arturas Lapiene
Hello,

I have problems with htb. The problem is that when I download
any file via shaper with htb, the traffic is very dinamic, 
it jumps, for example:
if i have set ceil = 128kbit the results that it jumps from 112kbps
to 144kbps or smth like that maybe its not very bad, but when the
traffic drops down to 40kbps or less and then after 1 or 2 seconds
jumps to 144kbps, its bad :-( and it is often.

Root class is 20Mbit
There are about 7000 classes (on two interfaces)

an example script: 

===
#!/bin/sh

TC="/sbin/tc"

INT_IF="eth1"
EXT_IF="eth0"

$TC qdisc del dev $INT_IF root
$TC qdisc del dev $EXT_IF root
$TC qdisc add dev $INT_IF root handle 1: htb r2q 1 default 2000 # tried default r2q
$TC qdisc add dev $EXT_IF root handle 1: htb r2q 1 default 2000

$TC class add dev $INT_IF parent 1: classid 1:1 htb quantum 6 rate 20Mbit ceil 
20Mbit
$TC class add dev $EXT_IF parent 1: classid 1:1 htb quantum 4 rate 20Mbit ceil 
20Mbit
$TC class add dev $INT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 
5kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 
5kbit
$TC qdisc add dev $INT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC class add dev $INT_IF parent 1:1 classid 1:2001 htb quantum 6 rate 682kbit 
ceil 2048kbit # tried to let htb itself calculate quantum, the same 
$TC class add dev $EXT_IF parent 1:1 classid 1:2001 htb quantum 6 rate 682kbit 
ceil 2048kbit
$TC qdisc add dev $INT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x 
flowid 1:2001
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x 
flowid 1:2001
$TC class add dev $INT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 
128kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 
128kbit
$TC qdisc add dev $INT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x 
flowid 1:2002
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x 
flowid 1:2002



linux 2.4.25
network cards: eepro100
HTB 3

Xeon 2.4GHz

Maybe I need to tune kernel, HZ or smth?

sorry for bad english 

--
Arturas
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] Re: HTB

2004-04-09 Thread Arturas Lapiene
Hello,

I have problems with htb. The problem is that when I download
any file via shaper with htb, the traffic is very dinamic, 
it jumps, for example:
if i have set ceil = 128kbit the results that it jumps from 112kbps
to 144kbps or smth like that maybe its not very bad, but when the
traffic drops down to 40kbps or less and then after 1 or 2 seconds
jumps to 144kbps, its bad :-( and it is often.

Root class is 20Mbit
There are about 7000 classes (on two interfaces)

an example script: 

===
#!/bin/sh

TC="/sbin/tc"

INT_IF="eth1"
EXT_IF="eth0"

$TC qdisc del dev $INT_IF root
$TC qdisc del dev $EXT_IF root
$TC qdisc add dev $INT_IF root handle 1: htb r2q 1 default 2000 # tried default r2q
$TC qdisc add dev $EXT_IF root handle 1: htb r2q 1 default 2000

$TC class add dev $INT_IF parent 1: classid 1:1 htb quantum 6 rate 20Mbit ceil 
20Mbit
$TC class add dev $EXT_IF parent 1: classid 1:1 htb quantum 4 rate 20Mbit ceil 
20Mbit
$TC class add dev $INT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 
5kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 
5kbit
$TC qdisc add dev $INT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC class add dev $INT_IF parent 1:1 classid 1:2001 htb quantum 6 rate 682kbit 
ceil 2048kbit # tried to let htb itself calculate quantum, the same 
$TC class add dev $EXT_IF parent 1:1 classid 1:2001 htb quantum 6 rate 682kbit 
ceil 2048kbit
$TC qdisc add dev $INT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x 
flowid 1:2001
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x 
flowid 1:2001
$TC class add dev $INT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 
128kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 
128kbit
$TC qdisc add dev $INT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x 
flowid 1:2002
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x 
flowid 1:2002



linux 2.4.25
network cards: eepro100
HTB 3

Xeon 2.4GHz

Maybe I need to tune kernel, HZ or smth?

sorry for bad english 

--
Arturas
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] Load Balancing w/ Proxies

2004-04-09 Thread RonSenykoff

Hello all.

I have load balancing (DSL + Cable)
ala nano HOWTO + some modifications. Works great.

      LAN
       |
  ---
  | LOAD    |
  |BALANCER |
  ---
  |        
|
Firewall  Firewall
  |        
|
Cable      DSL
Modem      Modem
  |        
|
Internet Internet


I would like to be able to define proxies
for certain applications so that I can force
them to use a particular interface
and thus control if they go out cable vs DSL. You think
I could install some kind of proxy
on the load balancing box and achieve this or will I need
to make two proxy server boxes, one
off each external interface on the load balancer?

I'm using the load balancer for home
office use. I want to specify, say for streaming video to use
the cable modem, as it has a much higher
download rate. I know I could create some static routes
for certain ports (I have already done
this using mangle) but I don't want to have to do
this every time I configure a new application.
By having 'proxies' any application that supports
proxy server can be configured for
a particular interface. It could be quite convenient. It doesn't
need to be a true proxy like Squid,
just something to relay the traffic.

Any ideas are greatly appreciated,
-Ron

[LARTC] Monitoring qdisks and classes.

2004-04-09 Thread Mike Mestnik
Are there any tools like iptraf or top to display tc stats?  I would like
to see things like flowes(TCP or UDP connections) as well as simple per
second stats.  I'm trying to monitor my p2p uploads and network
connections to see if things are getting into the right class.

I used to use mrtg for this, with some perl scripts I wrote.  This project
of mine has long since bitrotten.


__
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] link redundancy...

2004-04-09 Thread Cristiano Soares



Does anyone know how to make a link redundancy? I 
have two ADSL lines, and i want the linux machine to be able to switch between 
the two lines everytime the first ADSL line goes down. Thanks a 
lot.
 
Cristiano


Re: [LARTC] tcsim (was: Can I give more bandwidth to a specific URL)

2004-04-09 Thread Jason Boxman
On Tuesday 06 April 2004 17:29, Jason Boxman wrote:
> On Tuesday 06 April 2004 05:17, Martin A. Brown wrote:
> 
>
> > If you are just starting out with traffic control under Linux, I strongly
> > recommend learning and using tcng from the beginning.  The control
> > language offered by tcng (although technical) is much more like English
> > or human language than the more arcane tc syntax.  Here are some starting
> > points for learning about tcng [4] [5].  (Lest there be any doubt, you
> > will need tc, from iproute2, as well as tcng.)
>
> Speaking of TCNG, I read through the various guides and I still can't
> figure out how I am supposed to be using tcsim.  While I can get it to
> output information and graph it, the output does not mean anything to me. 
> I was expecting output similar to what appears on the HTB author's Web
> site, since that means a lot more to me.
>
> What is tcsim telling me exactly?

Does no one use tcsim?

> Thanks!
>
> 
>
> > -Martin
> >
> >  [0] http://lartc.org/
> >  [1] http://www.docum.org/
> >  [2] http://www.docum.org/stef.coene/qos/faq/cache/
> >  [3] http://tldp.org/HOWTO/Traffic-Control-HOWTO/
> >  [4] http://tldp.org/HOWTO/Traffic-Control-tcng-HTB-HOWTO/
> >  [5] http://linux-ip.net/gl/tcng/
>
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] Re:Multipath Masquerade

2004-04-09 Thread Mario
Donât mind my previous post â I figured out the issue, I wasnât properly setting 
broadcast addresses in the appropriate areas.  I rewrote my script to take this into 
account and it works great now â

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] tc command failed on 2.4.21 kernel

2004-04-09 Thread Stef Coene
On Thursday 08 April 2004 00:06, Reed Zhou wrote:
> Hi,
>
> Will TC work on 2.4.21 kernel without any patches? If it does, why tc
> command failed?
>
> For example,
>
> # tc qdisc show dev eth0
> RTNETLINK answers: Invalid argument
> Dump terminated
Do you run a kernel with QOS support ?

Stef

-- 
[EMAIL PROTECTED]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] Multipath IP Masquerade

2004-04-09 Thread Mario
Previously I attempted load balancing between 3 interfaces with limited
bandwidth but a common gateway with much more bandwidth using QoS and teql.
This had little to know luck because routes never seemed to come out right.
Someone pointed me in the direction of http://www.ssi.bg/~ja/nano.txt to try
and set up a multipath route instead.  After setting this up it seems that
all of the routes are always through eth0 instead of diving up between eth3
and eth1 as well. Could someone give me some direction why this is happening
or what I could do to fix it?

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] controlling uplinks per ip

2004-04-09 Thread Paras pradhan
hi all,

Newibe to tc and cbq

i have a linux (rh9) machine having one ethernet (eth0-public ip) to
internet  and second int (eth1) private ip ,to which all my workstation
connects.

scenario:

--|eth0--Linux Server---eth1|--192.168.2.11

i have used the following commands and my client 192.168.2.11 is limited
it's downlink to 96Kbit and it works great. now i want 192.168.2.11 not to
upload to outside world crossing 32Kbits. how do i do this?.



script that works for only downloads.
---

tc qdisc add dev eth1 root handle 10: cbq bandwidth 10Mbit avpkt 1000

tc class add dev eth1 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate
10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt 1000

tc class add dev eth1 parent 10:1 classid 10:100 cbq bandwidth 10Mbit rate
96kbit allot 1514 weight 10kbit prio 6 maxburst 20 avpkt 1000 bounded

tc qdisc add dev eth1 parent 10:100 sfq quantum 1514b perturb 15

tc filter add dev eth1 parent 10:0 protocol ip prio 100 u32 match ip dst
192.168.2.11 flowid 10:100

tc -d qdisc
-


Thanks in ADv...
Paras.



___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


[LARTC] Bandwidth limiting for each computer in subnet

2004-04-09 Thread Hamed Abangar
Dear members
 
I'm new to this list and also new to tc command.
I have a subnet with over 30 pc which have ip addresses from 172.16.1.1/16 range.I want that each computer in my subnet can work with internet with maximum 6k for download and maximum 6k for upload.when i run the following tc commands from my bridge the first pc works well but the second pc can not work with 6k and it has an almost dead connection with internet.I think somethings goes wrong because i want that each computer has 6k bandwith no all computer have 6 bandwith togeather...!
can any one help me
--
tc qdisc del dev eth0 root 2>/dev/null tc qdisc del dev eth1 root 2>/dev/null 
 
tc qdisc add dev eth0 root handle 10: cbq bandwidth 100Mbit avpkt 1000 cell 8tc qdisc add dev eth1 root handle 11: cbq bandwidth 100Mbit avpkt 1000 cell 8
 
tc class add dev eth0 parent 10:0 classid 10:3 cbq \        allot 1514 cell 8 maxburst 20 avpkt 1000 prio 3 \        bandwidth 48Kbit rate 48Kbit weight 1Kbit boundedtc qdisc add dev eth0 parent 10:3 sfq quantum 48Kbittc filter dev eth0 parent 10:0 protocol ip prio 1 u32 flowid 10:3 \        match ip src 172.16.1.1/16
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today

Re: [LARTC] Squid + shaping question

2004-04-09 Thread Andy Furniss
Teodor Yantchev wrote:
Hi folks,

So, I have a pretty simple setup - a linux router machine running as a
firewall/router for a small neighborhood LAN (approx 20 machines). I also
have squid running on the box in non-transparent mode, and also I have set
up NAT for TCP/UDP ports above 1024 for all clients and SSH/POP/SMTP/CVS
NAT'd for selected ones based on MAC filtering. No hosts whatsoever can
access ports 80 and 443 without going through squid. The uplink to the
internet is 512kbit/s downstream and 64kbit/s upstream cable modem connected
on eth1 (LAN on eth0, no DMZ).
When the LAN started to grow from a few well known friends of mine to more
people I didn't know so well 'social shaping' stopped working for us - bulk
downloaders started to saturate the link so badly that I even couldn't use
acceptably ssh from outside. So - the usual solution - www.lartc.org.
I did a lot of reading on the topic (This really got me interested in) and
finally ended up installing a self-modified version of wondershaper on the
external interface. This did solve the problem of me having usable ssh from
my office to the router machine, and the ingress qdisc partially solved the
problem of the downlink being fairly distributed between all incoming
connections - but as most of you know this is a half-baked bread. What I
think should be done is shaping the internal interface - BUT - the squid
in-between causes trouble.
So the question is - How to differentiate between traffic served from
squid's cache and traffic squid got directly from the internet ?
Shaping/policing all web traffic negates the benefits of having a caching
proxy pretty much.
After lots of googling and reading(at one point I was ready to completely
forget squid) a came up with the following alternatives, both found on the
FAQ section of www.docum.org - 'SQUID zero penalty for HIT traffic patch' by
a fellow bulgarian Marin Stavrev, and a patch giving you the ability to 'use
ACL lists to put packets in classes' by a guy named Patrick.
I'd like to ask you for your experiences with those, which one is better,
any other alternatives you know of and of course general
recipes/recommendations for solving my problem.
You could shape on just the internet link using IMQ with the NAT patch 
to control traffic from the inet to squid.

You can already shape up traffic - 64K for 20 machines isn't nice, but 
you can still do it if interactive traffic is less.

Given the other answers - I may be missing something, I've never used 
squid, but can shape local destined bittorrent OK.

Andy.

___
LARTC mailing list / [EMAIL PROTECTED]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/