Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcdel support for deletion per-network #80

Closed
dastergon opened this issue Aug 6, 2017 · 4 comments
Closed

tcdel support for deletion per-network #80

dastergon opened this issue Aug 6, 2017 · 4 comments
Assignees

Comments

@dastergon
Copy link
Contributor

Currently, tcdel supports deletion of all rules. However, it would be great if there were more fine grained options to delete rules based on the src-network, src-port, dst-network, dst-port etc.

Examples:

Deletion based on Individual IP:

 $ sudo tcdel --device eth0 --dst-network 192.168.1.2

Deletion based on CIDR block:

$ sudo tcdel --device eth0 --dst-network 192.168.1.2/24 
@thombashi thombashi self-assigned this Aug 8, 2017
@thombashi
Copy link
Owner

Thank you for your suggestion.

Finely grained delete option sounds good.
I will consider the feature for the future release.

@thombashi
Copy link
Owner

@dastergon
I've added the feature at tcconfig 0.14.0.
Now, you can delete a specific shaping rule by either network specifier or filter id.

+ tcset --device ens33 --delay 10 --rate 10k --network 192.168.1.2 --overwrite
+ tcset --device ens33 --delay 100 --rate 50k --network 192.168.1.3 --add
+ tcset --device ens33 --delay 200 --rate 100k --network 192.168.0.0/24 --add
+ tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.1.2/32, protocol=ip": {
                "delay": 10,
                "rate": "10K",
                "filter_id": "800::800"
            },
            "dst-network=192.168.0.0/24, protocol=ip": {
                "delay": 200,
                "rate": "100K",
                "filter_id": "800::802"
            },
            "dst-network=192.168.1.3/32, protocol=ip": {
                "delay": 100,
                "rate": "50K",
                "filter_id": "800::801"
            }
        },
        "incoming": {}
    }
}
+ tcdel --device ens33 --dst-network 192.168.1.2
+ tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.0.0/24, protocol=ip": {
                "delay": 200,
                "rate": "100K",
                "filter_id": "800::802"
            },
            "dst-network=192.168.1.3/32, protocol=ip": {
                "delay": 100,
                "rate": "50K",
                "filter_id": "800::801"
            }
        },
        "incoming": {}
    }
}
+ tcdel --device ens33 --id 800::801
+ tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.0.0/24, protocol=ip": {
                "delay": 200,
                "rate": "100K",
                "filter_id": "800::802"
            }
        },
        "incoming": {}
    }
}

@dastergon
Copy link
Contributor Author

@thombashi thank you very much for this new feature!

@thombashi
Copy link
Owner

I will close the issue then.
Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants