Is it possible to reverse engineer iproute tc commands?

-3

I have QOS working well in VyOS but need to move to TinyCoreLinux as I'll be sharing this VM as a lab router. VyOS is 400MB vs TCL which is 10MB.

Using the "set" commands in VyOS, it generates the tc output as follow:

**# tc -p qdisc show dev eth0**
qdisc htb 1: root refcnt 2 r2q 625 default 1f direct_packets_stat 0 direct_qlen 1000
qdisc sfq 8012: parent 1:1f limit 127p quantum 1514b depth 127 divisor 1024
qdisc sfq 8013: parent 1:a limit 127p quantum 1514b depth 127 divisor 1024
qdisc sfq 8014: parent 1:14 limit 127p quantum 1514b depth 127 divisor 1024
qdisc sfq 8015: parent 1:1e limit 127p quantum 1514b depth 127 divisor 1024

**# tc -p qdisc show dev eth1**
qdisc htb 1: root refcnt 2 r2q 625 default 2 direct_packets_stat 0 direct_qlen 1000
qdisc sfq 800f: parent 1:2 limit 127p quantum 1514b depth 127 divisor 1024

**# tc -p qdisc show dev eth2**
qdisc htb 1: root refcnt 2 r2q 625 default 2 direct_packets_stat 0 direct_qlen 1000
qdisc sfq 8016: parent 1:2 limit 127p quantum 1514b depth 127 divisor 1024

**# tc -p qdisc show dev eth3**
qdisc htb 1: root refcnt 2 r2q 625 default 2 direct_packets_stat 0 direct_qlen 1000
qdisc sfq 8011: parent 1:2 limit 127p quantum 1514b depth 127 divisor 1024

**# tc -p class show dev eth0**
class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 1375b cburst 1375b
class htb 1:a parent 1:1 leaf 8013: prio 0 rate 100000Kbit ceil 100000Kbit burst 15337b cburst 1600b
class htb 1:14 parent 1:1 leaf 8014: prio 0 rate 10000Kbit ceil 10000Kbit burst 15Kb cburst 1600b
class htb 1:1f parent 1:1 leaf 8012: prio 0 rate 1000Kbit ceil 1000Kbit burst 15Kb cburst 1600b
class htb 1:1e parent 1:1 leaf 8015: prio 0 rate 5000Kbit ceil 5000Kbit burst 15Kb cburst 1600b

**# tc -p class show dev eth1**
class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 1375b cburst 1375b
class htb 1:2 parent 1:1 leaf 800f: prio 0 rate 40000Kbit ceil 40000Kbit burst 15Kb cburst 1600b

**# tc -p class show dev eth2**
class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 1375b cburst 1375b
class htb 1:2 parent 1:1 leaf 8016: prio 0 rate 50000Kbit ceil 50000Kbit burst 15Kb cburst 1600b

**# tc -p class show dev eth3**
class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 1375b cburst 1375b
class htb 1:2 parent 1:1 leaf 8011: prio 0 rate 10000Kbit ceil 10000Kbit burst 15Kb cburst 1600b

**# tc -p filter show dev eth0**
filter parent 1: protocol all pref 1 basic
filter parent 1: protocol all pref 1 basic handle 0x1 flowid 1:a
  meta(rt_iif mask 0x00000000 eq 3)

filter parent 1: protocol all pref 2 basic
filter parent 1: protocol all pref 2 basic handle 0x1 flowid 1:14
  meta(rt_iif mask 0x00000000 eq 4)

filter parent 1: protocol all pref 3 basic
filter parent 1: protocol all pref 3 basic handle 0x1 flowid 1:1e
  meta(rt_iif mask 0x00000000 eq 5)

Is there a way to reverse engineer this to get the original commands?

I've tried looking through the VyOS perl code that generates the tc commands but it's all over the place with no comments and my perl knowledge isn't great.

I also tried renaming /sbin/tc to /sbin/tc_ and created a /sbin/tc script to try and log the commands but that didn't work very well for some reason.

linux
bandwidth-throttling
trafficshaping
iproute
tiny-core-linux
asked on Stack Overflow Oct 12, 2019 by letslogic.com

1 Answer

0

Found it in /var/log/vyatta/vyatta-commit.log

answered on Stack Overflow Oct 12, 2019 by letslogic.com

User contributions licensed under CC BY-SA 3.0