?
Solved

htb shape upload dsl

Posted on 2003-03-15
9
Medium Priority
?
514 Views
Last Modified: 2010-05-18
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?
0
Comment
Question by:drkbg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 3

Expert Comment

by:Ustas
ID: 8147991
#!/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
 
LVL 3

Expert Comment

by:Ustas
ID: 8147995
oops.. change eth1 to eth0..
0
 

Author Comment

by:drkbg
ID: 8148132
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
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 
LVL 3

Expert Comment

by:Ustas
ID: 8149873
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
 

Expert Comment

by:CleanupPing
ID: 9077657
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
 

Author Comment

by:drkbg
ID: 11221827
i got it... you need hust to shape on ppp0... not ethX
0
 
LVL 3

Expert Comment

by:Ustas
ID: 11231200
why did you give points to moderator????
0
 

Author Comment

by:drkbg
ID: 11234653
cause noone was close to the answer...and i needed to close this topic...
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 11349518
PAQed, with points refunded (75)

DarthMod
Community Support Moderator
Experts-Exchange
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question