-
Notifications
You must be signed in to change notification settings - Fork 28
ruleset: also run through the custom includes for the loopback interface #55
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
base: master
Are you sure you want to change the base?
Conversation
Before this change, the user defined include rules in the output and input chain were not evaluated for the loopback interface. Traffic related to this interface was always accepted. To ensure that the custom rules also apply to the loopback interface, move the custom rule in front of the input and output chain. These changes make it possible to evaluate rules for the loopack interface as well. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
|
Is it same? (gotta rebase that one anyway) |
|
@brada4 I would say no. My point is that packets coming or going to the loopback interface should also run through the custom If I understand yours correctly, then this is about offloading? |
|
No the part of swapping rules into I dont want to break your idea, just understand the intentm |
|
Which one? |
@feckert 's idea of pre-including rules before loopback openwrt#55 Remove iif lo check from each packet Part openwrt#22 Somewhat improving over a5553da Signed-off-by:
@feckert 's idea of pre-including rules before loopback openwrt#55 Remove iif lo check from each packet Part openwrt#22 Improves: a5553da Signed-off-by: Andris PE <neandris@gmail.com>
|
Like this? Ill patch up tests if it looks right to you. |
|
@brada4 I can't say anything about that yet. I haven't had a closer look at your change. |
|
Before Yours Mine Ie i remove 2 meta integer compares from normal in/out connections making them 1Mbps faster on low end devices. |
@brada4 The point is that the costum rules must also apply to the loopback device. If I look at your commits in #22 then you should use a prefix your commit header (have a look to the other commits in this repository). Also describe exactly what you are doing. Maybe then the review will be easier for the maintainer? Can I support you in any way to get #22 merged? |
|
I am splitting up #22, it is about distinct new features but in same script lines. For the order - yes custom rule will precede |
|
If you point @jow- to either of PRs you need there is slim hope he speed runs through all |
|
@reinerotto please compare to #56 - whether Documentation examples do not have anything in regard https://netfilter.org/projects/nftables/manpage.html That makes me think order is indifferent.... |
|
>That makes me think order is indifferent....<<
No.
Your example regarding squid works for CLIENTS only, I strongly suspect. Not for local traffic.
Needs special trick, then (for LOCAL traffic to be t-proxied, i.g. dnsmasq. Here for hev-socks5-tproxy, but should work for squid, as well) ( https://github.com/heiher/hev-socks5-tproxy):
Thus, based on hev-socks5-tproxy docs, I created
/etc/setup/hev-socks5-tproxy-fw2.nft:
#Only for local mode
#chain output_tproxy
meta mark 0x438 return
ip daddr @byp4 return
meta l4proto { tcp, udp } counter meta mark set 0x440
#}
And then I use it like this:
....#excerpt from /etc/config/firewall:
config include
option type 'nftables'
option path '/etc/setup/hev-socks5-tproxy-fw2.nft'
option position 'chain-post'
option chain 'mangle_output'
...
to make shure, hev-socks5-tproxy-fw2.nft is executed BEFORE chain output (prio: filter) will simply accept this local packet.
However, this is only a workaround for not being able to include IN VERY BEGINNING of output chain; it would be much clearer, to rectify this.
Am Montag, 13. Oktober 2025 um 13:14:10 OESZ hat Andrew ***@***.***> Folgendes geschrieben:
brada4 left a comment (openwrt/firewall4#55)
@reinerotto please compare to #56 - whether
ct state established accept ; tproxy (56)
tproxy ; ct state established (this 55)
is needed.
Documentation examples do not have anything in regard https://netfilter.org/projects/nftables/manpage.html
In other news it is appended after all rules.... https://wiki.squid-cache.org/Features/Tproxy4#iptables-on-a-router-device
That makes me think order is indifferent....
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Absolutely contradicts table purpose - why would you blindly pass bogon addresses before any other rule (it bypasses rest of rules) IMO make it eg |
|
https://github.com/heiher/hev-socks5-tproxy/blob/main/README.md#netfilter |
Before this change, the user defined include rules in the output and input chain were not evaluated for the loopback interface. Traffic related to this interface was always accepted.
To ensure that the custom rules also apply to the loopback interface, move the custom rule in front of the input and output chain. These changes make it possible to evaluate rules for the loopack interface as well.
I also posted this on the mailing list a year ago. But then it didn't go any further. So now I'm trying it via github.