Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a linux box that I use to simulate a WAN link between two nodes. This linux box has two subinterfaces on eth1 (eth1:11 and eth1:12). I'm successfully using netem / htb to simulate delay and bandwidth limits. However, it seems that the commands are applied globally to the eth1 interface, not to the subinterface. Is it possible to apply qdisc commands only to a specific sub interface?

For reference, here are the tc commands I am using:

tc qdisc add dev eth1:11 root handle 1:0 htb default 10
tc class add dev eth1:11 parent 1:0 classid 1:10 htb rate 1544kbit 
tc qdisc add dev eth1:11 parent 1:10 handle 10:0 netem delay 10ms 2ms 25% distribution normal
share|improve this question
up vote 0 down vote accepted

After much searching, I found out that this isn't possible with subinterfaces. It is, however, possible with a vlan interface. So - you can effectively achieve the same sort of setup if you have access to the port between your linux box and a switch, and your switch supports vlan tagging. Change the port on the switch to a trunk port and then create your vlan interfaces off of ethX. From there you can use tc to control the flow on a per vlan intereface.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .