I have:
- 2 linux boxes (A, B)
- 1 switch (S)
- 1 gateway (G) [I have no control over this one]
+---------------+ | switch S +-------+ +---+--------+--+ | | | +--+-+ | | | gw | +--+-+ +--+-+ +----+ | A | | B | +----+ +----+
Just for some testing purposes, I need to shape traffic coming from A before it reaches the gateway G. I inject traffic in A at the mac layer with tcpreplay
, so I cannot do the shaping directly on A.
My idea is to:
- route to B all traffic from A
- apply traffic shaping on B (Linux traffic control or dummynet)
- reroute to gateway G all traffic from A arriving at B
Is my solution fine? Is there a simpler one that doesn't require two (Ethernet) network interfaces on B?
Would a virtual network interface on B make my life easier?
What are some typical commands I need in order to deploy the above setting (traffic shaping excluded)?