Skip to contentSkip to conversation

traffic shaping between two LANs and one ppp0 default gw

DISCUSSION Thanasis 2 participants 5 messages Jun 10, 2010 – Jun 12, 2010

lore
Share & tools
lore

Thanasis

author
#0 lore raw

Maybe this is not directly related to netfilter, but I believe that someone may be able to help in this simple scenario:
A router (linux) has 3 NICs: eth1 (ppp0) connects to WAN via ADSL modem ~2Mbps/700Kbps up/down.
The other 2 NICs connect to local LANs with private IPs: eth0 to 192.168.0.0/24, and eth2 to 192.168.10.0/24.
The router provides internet connectivity to both LANs' PCs by NATing (the one public IP).
We would like to divide the incoming and outgoing bandwidth equally between those two LANs, ie:
PCs from the two LANs should not be able to upload more than 300Kbps (total per LAN) via either eth2 or eth0, so as not to flood the outgoing ppp0 interface.
On the other hand, routing packets between the 2 LANs (from eth2 to eth0 and vice versa) should not be restricted, ie should be at 100Mbps. How would this be best and simplest implemented by using iproute2 (tc) ?

#1 lore raw
Quoted 6 lines · Thanasis

We would like to divide the incoming and outgoing bandwidth equally between those two LANs, ie: On the other hand, routing packets between the 2 LANs (from eth2 to eth0 and vice versa) should not be restricted, ie should be at 100Mbps. How would this be best and simplest implemented by using iproute2 (tc) ?

tc + htb | cbq | another handful of queues are what you are looking for and google for that (also for larc)

P.s. As said in all the howtos that you can find, you can limit *only* upload speed (unless you use some trick and imq), so in you environment will be near impossible to split the download speed between the different lans since every queue are strictly linked with a interface, which cannot know each other

Michele

author
#2 lore raw

on 06/12/2010 05:36 PM Michele Petrazzo - Unipex wrote the following:

Quoted 7 lines

tc + htb | cbq | another handful of queues are what you are looking for and google for that (also for larc)
P.s. As said in all the howtos that you can find, you can limit *only* upload speed (unless you use some trick and imq), so in you environment will be near impossible to split the download speed between the different lans since every queue are strictly linked with a interface, which cannot know each other

Thanks !
I read that imq is being replaced by ifb :
(already in kernel: Device drivers -> Network device support -> Intermediate Functional Block support ).
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb

#3 lore raw
Quoted 4 lines · Thanasis

I read that imq is being replaced by ifb :
(already in kernel: Device drivers -> Network device support -> Intermediate Functional Block support ).
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb

Opss... Sorry for the wrong information!

P.s. If you are looking for a very simple and quickly setup, you can also look for shorewall that can also "talk" with ifb (www.shorewall.net/traffic_shaping.htm)

Michele

author
#4 lore raw

on 06/12/2010 06:23 PM Michele Petrazzo - Unipex wrote the following:

Quoted 7 lines
Quoted 4 lines · Thanasis

I read that imq is being replaced by ifb :
(already in kernel: Device drivers -> Network device support -> Intermediate Functional Block support ).
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb

Opss... Sorry for the wrong information!

No problem, not so wrong info after-all ;-)

Quoted 4 lines

P.s. If you are looking for a very simple and quickly setup, you can also look for shorewall that can also "talk" with ifb (www.shorewall.net/traffic_shaping.htm)

Interesting !
Thanks !