Simulating a slow connection with tc

If you want to apply limitation to all outbound traffic, you don't need filters at all. Just add your qdisc to the interface root handle like so:

tc qdisc add dev eth0 root handle 1: tbf rate 256mbit latency 1ms burst 1540

If you want to shape/police inbound traffic, it's a little more complicated. You'll need to use e.g. an IFB interface:

modprobe ifb
ip link set dev ifb0 up
tc qdisc add dev eth0 ingress
tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 action mirred egress redirect dev ifb0
#  ^- this is a dummy filter, match u32 0 0 matches all traffic
tc qdisc add dev ifb0 root handle 1: tbf rate 256mbit latency 1ms burst 1540

Here's a different approach, using two simple filters:

tc qdisc add dev eth0 ingress
tc filter add dev eth0 root         protocol ip u32 match u32 0 0 police rate 256mbit burst 10k drop flowid :1
tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 police rate 256mbit burst 10k drop flowid :1

This might be a bit out of your scope, but WAN-emu has been very good at emulating environments with strange requirements for throughput and latency[1]

[1]: http://speed.cis.nctu.edu.tw/wanemu/ WAN-emu