CGroups and net_cls to assign specific IPTables rules
This one was a quick and dirty that I will do better with soon. This will take a kernel that is nearing the 4.5 version capabilities. First modprobe: modprobe cls_cgroup Then create a CGroup for your “task”: mkdir /sys/fs/cgroup/net_cls/mytask Then give it a classid: echo 0x100001 > /sys/fs/cgroup/net_cls/mytask/net_cls.classid Now you can assign PIDs to the…