Git Product home page Git Product logo

Comments (6)

stangri avatar stangri commented on July 29, 2024

Overlap of 192.168.1.0/24 between two rules:

config policy
	option name 'hulu.com'
	option src_addr '192.168.1.0/24'
	option dest_addr 'hulu.com'
	option interface 'wan'

config policy
	option name 'ticketmaster.com'
	option src_addr '192.168.1.0/24'
	option dest_addr 'ticketmaster.com'
	option interface 'wan'

I can't reproduce, I've added those two policies to my test OpenWrt config and pbr started just fine in the nft_file mode.

from source.openwrt.melmac.net.

posita avatar posita commented on July 29, 2024

I can't reproduce, I've added those two policies to my test OpenWrt config and pbr started just fine in the nft_file mode.

Hmmm ... that's odd. I might have misunderstood when I received the error. What about with this?

config policy
	option name 'lan-to-wan'
	option src_addr '192.168.101.0/23'
	option dest_addr 'hulu.com'
	option interface 'wan'

config policy
	option name 'lan-guest-to-wan'
	option src_addr '192.168.101.0/23 192.168.102.0/23'
	option dest_addr 'espn.api.edge.bamgrid.com d2f2ekwwtg17a.cloudfront.net'
	option interface 'wan'

config policy
	option name 'to-vpn'
	option dest_addr 'espn.com'
	option interface 'vpn'  # or any VPN interface

from source.openwrt.melmac.net.

stangri avatar stangri commented on July 29, 2024

Yeah, that fails. I don't understand why nft sees a collision there. But if you split the middle policy into two, this works:

config policy
	option name 'lan-guest-to-wan'
	option src_addr '192.168.100.0/23'
	option dest_addr 'espn.api.edge.bamgrid.com d2f2ekwwtg17a.cloudfront.net'
	option interface 'wan'

config policy
	option name 'lan-guest-to-wan2'
	option src_addr '192.168.102.0/23'
	option dest_addr 'espn.api.edge.bamgrid.com d2f2ekwwtg17a.cloudfront.net'
	option interface 'wan'

from source.openwrt.melmac.net.

posita avatar posita commented on July 29, 2024

I can see several options here:

  1. Do the requisite set manipulation in pbr to accommodate the use case (my favorite, since it preserves the ergonomics of the documented parameters);
  2. Detect the failure mode in pbr, intercept it, and notify the user how to correct it (possibly with a reference to updated docs providing a more thorough explanation);
  3. Enumerate known failure modes with nft in the docs, and when any nft failure occurs, detect it and direct the user there to diagnose on their own (not nearly as ergonomic as either of the above, but probably less time to implement);
  4. Only update the docs (my least favorite, since it requires the user to map the cryptic error to the appropriate place in the docs, and doesn't work well for people like me, who've experienced a degradation post upgrade); or
  5. Fix the problem in nft (probably not viable; that workflow looks awful to me; even submitting/searching for a bug looks unnecessarily cumbersome given that it's 2024).

By "set manipulation", I mean that pbr could read the example from my #194 (comment) and (de?)normalize it to entries without any overlap, like that in your #194 (comment).

from source.openwrt.melmac.net.

stangri avatar stangri commented on July 29, 2024

You're welcome to contribute any improvement to both pbr and pbr docs on the matter.

Additionally it may be helpful to post the example of nft ip collision on the OpenWrt forum and if the nft gurus can suggest an easy way to create the nft file from this policy which would not be rejected by nft I'm game to implement it.

from source.openwrt.melmac.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.