Solved

How to shape internet bandwidth on a single interface Linux Server

Posted on 2014-04-01
3
272 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
[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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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