Would you like something like that, or do you have a different feature in mind?
#!/bin/bash # selfishnet v0.1 beta - prioritize your own IP IFACE="eth0" MY_IP="192.168.1.100" # change to your machine's IP LIMIT_OTHERS="1mbit" tc qdisc del dev $IFACE root 2>/dev/null Add HTB root tc qdisc add dev $IFACE root handle 1: htb default 20 Class for others tc class add dev $IFACE parent 1: classid 1:1 htb rate $LIMIT_OTHERS Class for yourself tc class add dev $IFACE parent 1: classid 1:2 htb rate 1000mbit Filter: others go to 1:1, you go to 1:2 tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip dst $MY_IP flowid 1:2 tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip src $MY_IP flowid 1:2 tc filter add dev $IFACE protocol ip parent 1: prio 2 u32 match ip dst 0.0.0.0/0 flowid 1:1 tc filter add dev $IFACE protocol ip parent 1: prio 2 u32 match ip src 0.0.0.0/0 flowid 1:1 selfishnet v0.1 beta
echo "Selfish mode active. Your IP: $MY_IP, others limited to $LIMIT_OTHERS" Would you like something like that, or do