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

Add SrcPort matching #51

Closed
lauhen opened this issue Feb 2, 2017 · 5 comments
Closed

Add SrcPort matching #51

lauhen opened this issue Feb 2, 2017 · 5 comments

Comments

@lauhen
Copy link

lauhen commented Feb 2, 2017

Hi,
currently you only support matching on the destination port with --port.
How about adding a source port match as well?
Thank you.

@thombashi
Copy link
Owner

thombashi commented Feb 3, 2017

@lauhen
Thank you for your suggestion. Please let me clarify that your suggestion.
What is your intention that "source port match" in this case? I come up with two cases:

  1. all of the traffic from certain port
  2. specific traffic route (e.g. traffic shaping to packets that routing from port 1234 to port 5678)
    • like --network and --src-network options of tcset

Did you mention 1. or 2. (or both 1. and 2.)?

1. can be achieved by current tcset
(e.g. tcset --device eth0 --direction incoming --port 80 --delay 100)

@lauhen
Copy link
Author

lauhen commented Feb 16, 2017

Thanks for your reply and sorry for the late answer:

  1. I want to match all the packets coming from a certain port, the destination port in this case is not important. I tried it with tcset --device eth0 --direction incoming --port 80 --delay 100 but the --debug message tells me that tc is still matching on dport not on sport
    A suggestion would be to split the --port argument into --sport and --dport so you could match on either the source-port or the destination-port or even both.

Thank you

@thombashi
Copy link
Owner

Thank you for your answer.

I want to match all the packets coming from a certain port,

You can achieve that by the tcset --device eth0 --direction incoming --port 80 --delay 100 command (ingress qdisc behave like sport although the command option is dport)

the source-port or the destination-port or even both.

However, the last case surely not achievable for the current tccset.
I will consider the option in the future release.

@thombashi
Copy link
Owner

@lauhen
I've added source port match feature at tcconfig 0.10.0 (--src-port option).

Thank you for your suggestion.

@tkoch96
Copy link

tkoch96 commented Jul 28, 2020

Is there any current way to specify one shared rule among several ports? Lets say one IP has open connections on 3 ports, and I want to limit the aggregate available bandwidth to 1Mbps over all these ports. I'm aware I can do 3 separate rules for each port, and limit available bandwidth to something that sums to 1Mbps, but this is a solution to a slightly different problem.

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

3 participants