Solved

How to shape internet bandwidth on a single interface Linux Server

Posted on 2014-04-01
3
270 Views
Last Modified: 2014-04-06
Hi all!

I have an old mac mini g4 (single ethernet) with debian on it.

I am very happy with it but, being also my download station, I want to be able to limit its bandwidth regarding internet.
Also updates and backups kill my network (main problem in upload).

I've read about wondershaper and similar tools but I don't want my server to be slow on LAN, just on the Internet.
Is there any way to achieve this?
0
Comment
Question by:ltpitt
  • 2
3 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 39970415
You need to put traffic shaper on your internet router.
0
 
LVL 1

Accepted Solution

by:
ltpitt earned 0 total points
ID: 39970666
No need to do that...

Simply install tc and wondershaper on the server you need to "calm down" and use a similar script:

# clear any existing configuration
wondershaper clear eth0

# root: let's use HTB
tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit

# the limit for fast, local connections:
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 95mbit burst 60k
# for the rest in teh intarweb (p2p, http ...):
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 30kbit burst 15k

# suggestion from the LARTC howto ...
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10

#  F I L T E R    local stuff (adapt "192.168.0.0" to your own LAN)
tc filter add dev eth0 parent 1:0 protocol ip prio 0 u32 \
   match ip dst 192.168.0.0/24 flowid 1:10

Open in new window

0
 
LVL 1

Author Closing Comment

by:ltpitt
ID: 39981051
Accurate, detailed, complete solution of the problem
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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