Solved

How to shape internet bandwidth on a single interface Linux Server

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ACK Attack 5 57
Red Hat Satellite 6.1 how can I set up a PXE boot ? 2 91
OpenVPN routing 2 43
Fail2ban says an IP is banned, but not 12 107
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

12 Experts available now in Live!

Get 1:1 Help Now