[LARTC] shaping domain names(www.xyz.com)

Stef Coene stef.coene@docum.org
Sat, 8 May 2004 20:45:01 +0200


On Saturday 08 May 2004 09:08, Michael Renzmann wrote:
> Hi.
>
> Stef Coene wrote:
> >>You could achieve this by using different firewall marks for the
> >>different traffic classes, and shape upon that marks. IIRC there is an
> >>iptables-extension available that allows to match strings, so you could
> >>try to match "Host: <domain>" in order to distinguish the different
> >>domains. But I have no idea if this would work in real world, nor what
> >>performance impact that may have.
> >
> > Only one problem.  Tc sees ip packets and ip packets contains ip
> > addresses, not hostnames.  So you can't do this.
>
> But tc sees the fwmark value that iptables has attached to a packet,
> right? Hence the idea to accomplish the "destination host distinction"
> with iptables-rules, setting fwmark accordingly and let tc decide on the
> different fwmark values.
But when do you see the hostname?  In the dns request and maybe in the http=
=20
request.  For all other packets only the ip address is known.

Rereading the original post, I think he has an other problem.  I think he i=
s=20
speaking of a web-server that's been hosts on different ip addresses.  Like=
=20
google.com:

Name:   google.com
Address: 216.239.57.99
Name:   google.com
Address: 216.239.39.99
Name:   google.com
Address: 216.239.37.99

So you have to shape on 3 ip addresses.  For that problem you can use iptab=
les=20
to mark packets and use googe.com.  It will be expanded to 3 rules matching=
=20
the 3 ip addresses.

Stef

=2D-=20
stef.coene@docum.org
=A0"Using Linux as bandwidth manager"
=A0 =A0 =A0http://www.docum.org/