htb shape upload dsl

hi! :)

first of all my network looks something like this. there is a switch on wich are connected dsl bridge modem, server and client boxes. the server machine act as dns, web server and router/firewall. It's a slack install. I figured out how to shape the incoming traffic for clients (the download from internet) but im still confused hwo to do it with outgoing traffic. the problem is that i have only one real IP which in fact changes every 24 hours and i have to use MASQUARADING. i mean that i wan every clinet mahcine to have X kb/s upload and if there is free bandwith to get the whole bandwith. I am using htb to shape incoming traffic from internet. any suggestions how to shape the uploads to internet?
drkbgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

UstasCommented:
#!/bin/bash
/sbin/tc qdisc del dev eth0 root 2>/dev/null

        AQ="/sbin/tc qdisc add"
        AC="/sbin/tc class add"
        AF="/sbin/tc filter add"

###########################################################$AQ dev eth0 root handle 10: cbq bandwidth 100Mbit avpkt 100 cell 8
##For a 100Mbps nic

$AC dev eth1 parent 10:0 classid 10:1 cbq \
        allot 1514 cell 8 maxburst 20 avpkt 1000 prio 2 \
        bandwidth 100Mbit rate 100Mbit weight 10Mbit

############################################################## DSL upload

##Total Upload (fast) ;)) Specify your max upload here
$AC dev eth1 parent 10:0 classid 10:1100 cbq \
        allot 1514 cell 8 maxburst 20 avpkt 1100 prio 4 \
        bandwidth 512Kbit rate 512Kbit weight 52Kbit  bounded

$AQ dev eth1 parent 10:1100 handle 100: cbq bandwidth 100Mbit avpkt 100 cell 8

##Child leaf node for DSL upstream. Define various speed #classes here
$AC dev eth1 parent 100:0 classid 100:1 cbq \
        allot 1514 cell 8 maxburst 20 avpkt 1100 prio 5 \
        bandwidth 100Kbit rate 100Kbit weight 10Kbit bounded
$AC dev eth1 parent 100:0 classid 100:2 cbq \
        allot 1514 cell 8 maxburst 20 avpkt 1100 prio 5 \
        bandwidth 200Kbit rate 200Kbit weight 20Kbit bounded
$AC dev eth1 parent 100:0 classid 100:3 cbq \
        allot 1514 cell 8 maxburst 20 avpkt 1100 prio 5 \
        bandwidth 100kbit rate 160Kbit weight 16Kbit bounded


##SFQ to all.. Use this queueing disc.. Easier on CPU ;)
$AQ dev eth1 parent 100:1 handle 1001:  sfq quantum 100Kbit
$AQ dev eth1 parent 100:2 handle 1002:  sfq quantum 200Kbit
$AQ dev eth1 parent 100:3 handle 1003:  sfq quantum 160Kbit

##Start Filters - Place ur custom rules for
# particular machines.

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

### Put all ADSL upload to 10:1100 (With any ADSL subnets)
$AF dev eth1 parent 100:0 protocol ip prio 1 u32 match \
ip src 192.168.0.1/32 flowid 100:2
## Here you are giving machine 192.168.0.1 upload of class 100:2 that is 200Kbps

Well work your way from here.. This is a part of my script that handles hundreds of rules. This is in fact part of traffic shaping for ISP's outgoing traffic
0
UstasCommented:
oops.. change eth1 to eth0..
0
drkbgAuthor Commented:
but does this work with masquerading?
somehow this shapes the traffic to the server only not to the internet... i think that packets not for the server but for the internet are masquearaded. and all internal IPs get the masquearading ip and and that stage they cannot be shaped :(. i'm not really sure that what im'm talking is the full truth, but it's something like this.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

UstasCommented:
you can only shape the upload.. That is out from the server. What your interest is to make the filters right. That is if you specify that the filters have src from your internal network, things should work out right. Did you try the sfq ??
0
CleanupPingCommented:
drkbg:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
drkbgAuthor Commented:
i got it... you need hust to shape on ppp0... not ethX
0
UstasCommented:
why did you give points to moderator????
0
drkbgAuthor Commented:
cause noone was close to the answer...and i needed to close this topic...
0
DarthModCommented:
PAQed, with points refunded (75)

DarthMod
Community Support Moderator
Experts-Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.