title: tc filter does not match ip address, only range
body: <p>I am trying to build virtual network for simulation. Links are determined by IP addresses and I can shape traffic and set up delay for range defined by netmask</p>
  
  <pre><code>#!/bin/bash
  VETH_1="vethf4dbb89"
  
  tc qdisc del dev $VETH_1 root
  
  tc qdisc add dev $VETH_1 root handle 1: htb default 14
  tc class add dev $VETH_1 parent 1: classid 1:0 htb rate 1000Mbps
  
  tc class add dev $VETH_1 parent 1:0 classid 1:2 htb rate 1000Mbps
  tc class add dev $VETH_1 parent 1:0 classid 1:3 htb rate 1000Mbps
  tc class add dev $VETH_1 parent 1:0 classid 1:4 htb rate 1000Mbps
  tc class add dev $VETH_1 parent 1:0 classid 1:5 htb rate 1000Mbps
  
  
  tc qdisc add dev $VETH_1 parent 1:2 handle 12: netem loss 0% 1% delay 30ms 10ms
  tc qdisc add dev $VETH_1 parent 1:3 handle 13: netem loss 0% 1% delay 200ms 10ms
  tc qdisc add dev $VETH_1 parent 1:4 handle 14: netem loss 0% 1% delay 10ms 10ms
  tc qdisc add dev $VETH_1 parent 1:5 handle 15: netem loss 0% 1% delay 15ms 10ms
  
  tc filter add dev $VETH_1 parent 1: protocol ip prio 1 u32 match ip dst 172.17.0.3/24 flowid 1:2 
  </code></pre>
  
  <p>But I need filter only specific IP address like</p>
  
  <pre><code>tc filter add dev $VETH_1 parent 1: protocol ip prio 1 u32 match ip dst 172.17.0.3 flowid 1:2 
  tc filter add dev $VETH_1 parent 1: protocol ip prio 1 u32 match ip dst 172.17.0.4 flowid 1:3 
  tc filter add dev $VETH_1 parent 1: protocol ip prio 1 u32 match ip dst 172.17.0.5 flowid 1:4 
  tc filter add dev $VETH_1 parent 1: protocol ip prio 1 u32 match ip dst 172.17.0.6 flowid 1:5
  </code></pre>
  
  <p>In first case with /24 all packets are captured correctly. Second configuration without netmask does not capture any packet.</p>
  
  <pre><code>tc -s qdisc ls dev veth09840d5
  qdisc htb 1: root refcnt 2 r2q 10 default 14 direct_packets_stat 110795 direct_qlen 2
   Sent 268440356 bytes 269182 pkt (dropped 0, overlimits 0 requeues 0) 
   backlog 0b 0p requeues 0 
  qdisc netem 12: parent 1:2 limit 1000 delay 30.0ms  10.0ms
   Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
   backlog 0b 0p requeues 0 
  qdisc netem 13: parent 1:3 limit 1000 delay 200.0ms  10.0ms
   Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
   backlog 0b 0p requeues 0 
  qdisc netem 14: parent 1:4 limit 1000 delay 10.0ms  10.0ms
   Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
   backlog 0b 0p requeues 0 
  qdisc netem 15: parent 1:5 limit 1000 delay 15.0ms  10.0ms
   Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
   backlog 0b 0p requeues 0 
  </code></pre>
  
  <p>EDIT:
  Only ip address that is assigned to defined interface is captured as destination. But how to slow down other ip addresses?</p>