-
Notifications
You must be signed in to change notification settings - Fork 759
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
Traffic Shaping: Direction-"out"-Rules do not match any traffic! #1900
Comments
|
2 Pipes, 2 Queues with 2 different rules for 2 WANs please. Changing IFs sometimes require are reboot |
|
Sure. It is only for testing purpose the same queue. |
|
Does changing 0E4_WAN to Default fix this? (Just a test) |
|
Yes, traffic shaper for 0E4_WAN5 is working in this case (if it is the default gateway). |
|
Hi guys, It's perfectly possible that despite shared forwarding not everything is being shared correctly yet. This will take some time to get to the bottom of. I expect we can look at this in December. It will definitely require kernel patching and I'm not available most of November. Cheers, |
|
PS: @SeTk if you can try this with 11.1 base/kernel applied, shared forwarding was improved, now also includes IPv6 if that matters here... https://forum.opnsense.org/index.php?topic=6257.0 |
|
Sorry. I don't want to try 11.1, because both our opnsense machines (in HA configuration) are in 24/7 productive use. You don't recommend to try 11.1 in HA-productive use, do you? |
|
We need the data points at one point or another before 18.1 is out to work on this, but I would not recommend this in your setup at the moment. Theoretically 11.0 and 11.1 are similar in nature so syncing between them should not be a problem. You could also skip the „b“ in these test commands to only update the kernel which gives you even less friction. After a week or two with no other problem report in the forum it’s worth a try. |
|
Ok, I've upgraded to 11.1, rebooted and tested again. |
|
Thank you, at least we know we need to look at the routing code and that the buggy behaviour is consistent. 👍
… On 31. Oct 2017, at 19:08, SeTk ***@***.***> wrote:
Ok, I've upgraded to 11.1, rebooted and tested again.
The issue is still there. :(
Default gateway: Out-Rules matching/working.
Other gateways: Out-Rules don't match/work.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
@SeTk For me it's working. I'm currently playing with the Traffic Shaper and build a small test bed. I have 2 WANs, one static with 100Mbit (default) and one with a ADSL router in front. When I set a firewall rule to send traffic vom LAN_X via ADSL it's perfectly shaped like I set the values in the pipe's. But what I experienced was, that CoDel doesn't do what I want ... I can shape to exact values, but ping times are always bad (also with default gateway). |
|
@mimugmail Ok, let's compare oure configurations for upload traffic shaper. WAN1 is default. Pipes:
Rules:
To keep sure, configuration is used, I've reseted traffic shaper. Testing from VLAN with WAN1 gateway or default gateway configured: Upload is limited to 5 Mbit/s. Change the setup, so that WAN2 is default gateway allows 20 Mbit/s upload in both cases. Could you attach screenshots of your pipes and rules in advanced mode? Thank You for your support! |
|
@SeTk Hm, in my setup I only tested up/down at same speeds .. now I tweaked the values and get the same behaviour as yours. WAN1 (d) UP works @fichtner I'll backup the config and keep this lab alive if you want to do some testing after vacation. |
|
Thanks. :) |
|
Hi @SeTk @mimugmail , I too am observing the same problem and this is on 17,7,8,,,shaper is not restricting the traffic per the bandwidth set. I am open to test this as i have decoupled my HA |
|
I am experiencing the exact same issue: WAN1 (d) UP works I.e.: In this example, queue 10008 should have been used (em4), WAN2, and not 10006 (em2, WAN1) Disabling Shared forwarding results in no UP queue (10006, 10008) being used, but down queues work. Has there been any more tracking down going on on this issue? Something that I could try? I was thinking about defining no default gateway, but then the policy based routes return destination unreachable for some reason!? |
|
I would like to investigate this further since it's blocking a major upgrade (from pfsense 2.0.1); is there any starting point in which direction to look? |
|
I have compared sources from pfsense (where this works) to opnsense. In opnsense, the function pf_route was split into pf_route and pf_route_shared depending on the sysctl value for shared forwarding.
There is also much more "meat" to r->rt being flagged PF_ROUTETO . I am not enough pf expert to determine whether this is relevant or not, and the code is mostly undocumented, but would that be something to start looking at? |
|
Not sure if this is relevant. You can try to turn off shared forwarding to see what happens, but you must also clarify if you compare pfsense shaper or limiter. The pfsense shaper is ALTQ. The limiter is ipfw/dummynet, which is our shaper...
… On 4. Mar 2018, at 11:29, Namezero ***@***.***> wrote:
I have compared sources from pfsense (where this works) to opnsense.
In opnsense, the function pf_route was split into pf_route and pf_route_shared depending on the sysctl value for shared forwarding.
PFSense has not done this, but has pf_route differences (2.4) that have the following comment:
Send it out since it came from state recorded ifp(rt_addr).
Routing table lookup might have chosen not correct interface!
There is also much more "meat" to r->rt being flagged PF_ROUTETO .
I am not enough pf expert to determine whether this is relevant or not, and the code is mostly undocumented, but would that be something to start looking at?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Thanks for the answer. That's why i'm suspecting somehow a wrong interface index or something. |
|
Baseline is important still, see shaper / limiter question. We wrote shared forwarding because ipfw and pf in FreeBSD do not go together well. There could be further bugs, but it's essentially non-reproducible in pfSense or FreeBSD because of that.... |
|
Not an expert at all at pf; first time looking at its source and trying to figure anything out, but just reading for now because I'm not sure exactly what to be looking for. |
|
Still, simple question: in pfSense did you compare against shaper or limiter? |
|
kernel -out (out WAN2): |
|
Yay. 👍 (more feedback welcome) |
Many thanks to everyone testing, prodding and pushing for this! :) PR: opnsense/core#1900
|
Final patch is opnsense/src@d1cb3383d if all feedback is good |
|
I can confirm both patches work, and although I can't comment on the smoothness of the flips scientifically, the out patch "behaves" better apparently. Interesting how the fixed code is the exact same but patches elsewhere (save for the DIR_OUT in the final commit) Congratulations on a job well done :} Excellent detective work :D Will be see this in head soon? |
|
Symmetry issue... fixed pf in that area later, but ipfw needs the same obviously The extra explaining made this abundantly clear so thanks for asking! :) |
|
Any time; especially after digging through that code I have plenty of questions :D. |
|
It makes so much fun woking on this project, really enjoy the progress 👍 |
|
Alright so I don't know when we ship this, possibly with the next round of OS security fixes (FreeBSD advisories). If you want to keep this kernel, you can lock it under System: Firmware: Packages, but do not forget to unlock once this really ships, otherwise you'll miss out on security patches. Thanks everyone, time to close this ❤️ |
|
Glancing over this today it seems that IPv4 works now but not IPv6, so here's another kernel: Cheers, |
|
(confirmation that IPv4 works as before is probably enough at this point) |
|
Works as expected with v4 |
|
btw. enabling CoDel for the W2FQ sched makes the 500kb upload WAY more smother .. 👍 |
|
We don't have IPv6 yet so I'm unable to check for that, but the new kernel (18.1.5-ipfw) also works for IPv4 here :} |
|
Ok interesting. Why rshift IPV6_VERSION? |
|
@namezero111111 copied from the same function a number of lines below |
|
@fichtner Is it possible the patch messes with NAT? Or maybe there is another issue? It appears as though with a gateway group, the wrong NAT IP is used. Example: DMZ1 and DMZ2 gateways are in a gateway group, patched kernel applied. Pings time out/website won't load, etc... When NAT rules are reversed in priority, it seems like something else is affected here by a similar issue. |
|
Excerpt from rules.debug looks good: With shared forwarding off the problem does not occur. Turning it back on reproduces it again. |
|
18.1.5 or latest master? |
|
Yes, unfortunately on both :/ |
PR: opnsense/core#1900 (cherry picked from commit d1cb338) (cherry picked from commit d59de14) (cherry picked from commit 529bbe6)
|
I mean why he was asking about the latest version. |
|
I'm not sure the patch does anything here. NAT is done in pf, not ipfw. It means you'll likely see the issue on a stock 181.5. And I'm not even sure since you said gateway group and NAT it heavily depends on your WAN state, monitoring and load balancing rules. |
|
@namezero111111 I tested with NAT on both WANs, sure! Today I'm in the office, if you need more tests just put it here .. |
|
Ok, this seems solely related to "Disable State Killing on Gateway Failure". When unchecked (i.e. state killing enabled) the behavior occurs. |
|
Best news today :) |
|
:) |
|
Same issue occurs again with OPNsense 20.7.7_1. |
#Using: OPNsense 17.7.7_1-amd64
with mutliple gateways and gateway-groups for redundancy.
Shared forwarding is enabled.
Problem: I am not able to shape outgoing traffic (e.g. for VoIP).
Issue: Using an direction-out-rule only works with default gateway.
On all other gateway-interfaces, traffic does not match and bypasses the shaper.
In out setup 004_WAN7 is our default gateway.

A rule for traffic leaving this interface works. Outgoing traffic matches and goes through the shaper.
But choosing any other interface such as 0E4_WAN5 does not work.

There is outgoing traffic; but it does not match. It bypasses the shaper.
Outgoing traffic flow:
WORKING: LAN-Interface > Firewall-Rules (without route to / gateway = default gateway WAN7) > Traffic-Shaper > WAN7-Gateway-Interface
SHOULD WORK: LAN-Interface > Firewall-Rules (with route to / gateway WAN5 = WAN5) > Traffic-Shaper > WAN5-Gateway-Interface
WHAT HAPPENS: LAN-Interface > Firewall-Rules (with route to / gateway WAN5 = WAN5) > BYPASSES Traffic-Shaper > WAN5-Gateway-Interface
Incoming traffic works in traffic shaper without any problems.
The text was updated successfully, but these errors were encountered: