Re: Limit *sum* of upstream plus downstream?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Di 27.11.2012, 10:22:32 schrieb Jack Bates:
> How can I limit the *sum* of upstream plus downstream traffic on my WAN
> interface (eth0.2) to < 1.5mbit? (in order to "own" my queue)

I don't get the sense of that but it should be possible; I don't know whether 
there is a better solution than my idea, though.

This can be done by forcing both kinds of traffic through the same interface. 
This can be done by running a virtualized Linux on the same system. Maybe it's 
possible with lxc, too (I am not familiar with that).

Using libvirt/KVM you could create a private network and a guest with two 
interfaces on this host-only network.

Host:
private0 - 192.168.220.1

Guest:
eth0: 192.168.220.2
eth1: 192.168.220.3

On the host you change the routing so that both traffic coming from the WAN 
interface and traffic for the WAN interface (both created locally and 
forwarded) is sent via the virtual interface private0 either to the guests 
eth0 (ingress) or to its eth1 (egress). The guest simply sends everything from 
eth0 back to private0 via eth1 and the other way round.

The normal routing is done on traffic coming in on private0 only. This can be 
done by advanced routing (ip rule), selecting by the input interface. The 
traffic shaping can then be done by a HTB on private0.

Sounds a bit crazy and I have to admit that I have never done that but I don't 
see any reason why it shouldn't work. The virtualized NICs can be virtio 
devices thus minimizing the overhead.


Hauke
-- 
☺
PGP: 7D82 FB9F D25A 2CE4 5241 6C37 BF4B 8EEF 1A57 1DF5 (seit 2012-11-04)

Attachment: tc_on_sum_of_ingress_and_egress.png
Description: PNG image

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux