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

iprule: add ipproto property #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

systemcrash
Copy link

config rule
	option ...
	option ipproto '17'

This allows handling rules which anchor to protocol number like:

ip ru add from all ipproto udp table udp_table prior 10

Handle ipproto as an unsigned integer.

https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Tested on 23.05.5 x86_64

@systemcrash
Copy link
Author

Note to self:

update wiki post-merge https://openwrt.org/docs/guide-user/network/routing/ip_rules

```
config rule
	option ...
	option ipproto '17'
```

This allows handling rules which anchor to protocol number like:

`ip ru add from all ipproto udp table udp_table prior 10`

Handle ipproto as an unsigned integer.

https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Example:

config rule
	option in 'lan'
	option src '10.48.0.0/16'
	option out 'lan'
	option dest '192.168.1.144/32'
	option lookup 'main'
	option ipproto '17'

Results in

~# ip rule
0:	from all lookup local
1:	from 10.48.0.0/16 to 192.168.1.144 iif br-lan oif br-lan ipproto udp lookup main

Tested on 23.05.5 x86_64

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
@systemcrash
Copy link
Author

@dangowrt @nbd168 could we get this merged please?

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

Successfully merging this pull request may close these issues.

1 participant