LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2014, 06:06 PM   #1
c0d0s1
LQ Newbie
 
Registered: Jul 2014
Posts: 1

Rep: Reputation: Disabled
Internet traffic shaping between two LANs


Hi guys, it's my first post here

I've got wlan0 connected to the internet, and it routes packets (nat & forwarding) between two adapters: eth0 and ap0. I need to set priority eth0 (much) over ap0... I just need to do something like packets from and to eth0 are forwarded instantly, and packets from and to ap0 allways must wait and use as much bandwidth as is free. But i don't know how :/
I draw the topology here:
http://i.imgur.com/A6TMxL1.png

I read that it's related to the tc command, but i don't understand these tutorials... Please help me guys
 
Old 07-28-2014, 02:39 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,880

Rep: Reputation: 162Reputation: 162
You can set shaper of HTB format. That is easy to understand. The rate of over ap0 is 0, that means the traffic only use the bandwidth that eth0 left over.
 
Old 07-30-2014, 06:10 PM   #3
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Read this - http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm

Then try someting like this -

Configure an HTB Q outbound on wlan0

$ tc qdisc add dev wlan0 root handle 1: htb default 3


Define the traffic you want to be given preferential treatment (i.e. traffic from eth0-

$ tc filter add dev wlan0 protocol ip parent 1:0 prio 1 u32 \
match ip src 1.2.3.4 flowid 1:1


Create a class encompassing all traffic set to match your outbound bandwidth via wlan0-

$ tc class add dev wlan0 parent 1: classid 1:1 htb rate 1000kbps


Create a sub-class defining the htb bandwidth assigned to your special traffic -

$ tc class add dev wlan0 parent 1:1 classid 1:2 htb rate 990kbps ceil 1000kbps


Create the default sub-class ( 3 as assigned in the first command) defining the bandwidth guaranteed to everything else -

$ tc class add dev wlan0 parent 1:1 classid 1:3 htb rate 10kbps ceil 1000kbps


Check out the results -

$ tc qdisc show dev eth0
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Traffic Shaping VoiP using TC (Traffic Control) is this working? Nemus Linux - Networking 0 05-16-2011 01:45 PM
Problem with Traffic Shaping and HTTP Traffic. redvivi Linux - Networking 1 11-29-2008 12:23 PM
Traffic shaping (limiting outgoing bandwidth of all TCP-traffic except FTP/HTTP) ffkodd Linux - Networking 3 10-25-2008 12:09 AM
Best internet traffic shaping for small lan zatys Linux - Networking 0 02-13-2006 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration