From: VZ Cambria Date: Tue, 14 Feb 2017 23:22:04 +0000 (-0500) Subject: Refine tc rules X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=4109a338687ad59d8042030f25d63b7c6c6ea07f;p=cni.git Refine tc rules --- diff --git a/pkg/ipam/ipam.go b/pkg/ipam/ipam.go index 8d3fe05..21110ba 100644 --- a/pkg/ipam/ipam.go +++ b/pkg/ipam/ipam.go @@ -74,6 +74,17 @@ func ConfigureIface(ifName string, res *types.Result) error { result = string(cmdOut) fmt.Println("The result of qdisc show is: ",result) +/* + ["ip", "netns", "exec", str(pid), "tc", "filter", "add", "dev", "eth0", "parent", "ffff:", "protocol", "ip", + "prio", priority, "u32", "match", "u8", hexgid, "0xf0", "at", "15", "flowid", ":2", "action", "pass”]) +*/ + + // cmdName = "tc" + cmdArgs = []string{"filter", "add", "dev", ifName, "parent", "ffff:", "protocol", "ip", "prio", "2", "u32", "match", "u8", "0xc0", "0xf0", "at", "15", "flowid", ":10", "action", "pass" } + if cmdOut, err = exec.Command(cmdName, cmdArgs...).Output(); err != nil { + return fmt.Errorf("There was an error adding tc filter to %q: %v", ifName, err) + } + // cmdName = "tc" cmdArgs = []string{"filter", "add", "dev", ifName, "parent", "ffff:", "protocol", "ip", "prio", "2", "u32", "match", "ip", "src", "10.37.2.1/32", "flowid", ":10", "action", "pass" } if cmdOut, err = exec.Command(cmdName, cmdArgs...).Output(); err != nil {