Solved

How to shape internet bandwidth on a single interface Linux Server

Posted on 2014-04-01
3
269 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 61

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

Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

Question has a verified solution.

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

Suggested Solutions

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now