SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got setup a traffic control on my server/router to prevent a box that is constantly downloading to fill the line up. So I've limited its download to 512Kbps with a ceiling with 640Kbps, and upload to 128Kbps with a ceiling of 196Kbps. It works great, it limits it's download and upload, but the problem is that now the server and that box can't communicate faster, on a full 100MBit connection of a LAN.
This is my firwall rule for NAT:
Code:
IPT = /usr/sbin/iptables
EXTIF=ppp0
INTIF=eth1
VPNIF=vpn0
VPNIPRANGE=10.8.0.0/24
$IPT -A FORWARD -i $EXTIF -o $INTIF -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPT --table mangle -A FORWARD -i $EXTIF -o $INTIF -j MARK --set-mark 10
$IPT -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPT --table mangle -A FORWARD -i $INTIF -o $EXTIF -j MARK --set-mark 20
$IPT -A FORWARD -i $VPNIF -o $INTIF -s $VPNIPRANGE -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i $INTIF -o $VPNIF -d $VPNIPRANGE -j ACCEPT
$IPT --table nat -A POSTROUTING -o $VPNIF -d $VPNIPRANGE -j MASQUERADE
$IPT --table nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
And then this is the traffic control section:
Code:
TC=/sbin/tc
IP=/sbin/ip
BANDMAX=102400
DOWNMAX=512000
DOWNCEIL=640000
UPMAX=128000
UPCEIL=196000
$TC qdisc del dev $INTIF root
$TC qdisc add dev $INTIF parent root handle 1:0 htb default 20
$TC class add dev $INTIF parent 1:0 classid 1:1 htb rate ${BANDMAX}kbit quantum 1500
# Download
$TC class add dev $INTIF parent 1:1 classid 1:10 htb rate ${DOWNMAX}kbit ceil ${DOWNCEIL}kbit
$TC qdisc add dev $INTIF parent 1:10 handle 10:0 sfq
# Upload
$TC class add dev $INTIF parent 1:1 classid 1:20 htb rate ${UPMAX}kbit ceil ${UPCEIL}kbit
$TC qdisc add dev $INTIF parent 1:20 handle 20:0 sfq
$TC filter add dev $INTIF parent 1:0 protocol ip handle 10 fw classid 1:10
$TC filter add dev $INTIF parent 1:0 protocol ip handle 20 fw classid 1:20
$IP rule add fwmark 20 table 20
$IP rule add fwmark 10 table 10
Could someone please point to the problem why the connection between the box and the server isn't faster?
So you want full speed 100Mbit on ppp0 and traffic control on eth1? ppp0 is a virtual interface, it is a gre tunnel(or somewhat else tunnel), it's traffic actually goes through eth1.
So if you eliminate traffic on eth1, you do so for ppp0 too.
You mentioned that you do want full speed on LAN, than OK, LAN interface, I am sure, is eth1, while your internet i-face is ppp0. (wrote that just to make it clear)
I know, ppp0 is a external link, virtual interface running over eth0 with is the LAN card connected to the XDSL modem, I don't want to limit this speed for the server, I just want to limit the speed which comes in through the ppp0 and is being routed over to eth1 which is connected to another machine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.