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

IpTablesRule.Parse() exception because Tcp ModuleEntry is not loaded #36

Open
mark1145 opened this issue Dec 1, 2024 · 1 comment
Open

Comments

@mark1145
Copy link

mark1145 commented Dec 1, 2024

Hi,

I'm trying to create a new rule, but when doing IpTablesRule.Parse() it throws an exception Unknown option: "--source-port".

From what I can see in the code, I believe it's because the TcpModule is not being loaded into the CommandParser. Do I need to somehow Load the module first? How would I go about parsing other rules where the module is not loaded by default please?
https://github.com/splitice/IPTables.Net/blob/master/IPTables.Net/Iptables/Modules/Tcp/TcpModule.cs

Thank you!

IPTables.Net.Exceptions.IpTablesNetException: Unknown option: "--source-port"
at IPTables.Net.Iptables.Modules.CommandParser.FeedToSkip(Int32 position, Boolean not)
at IPTables.Net.Iptables.IpTablesCommand.Parse(String rule, IpTablesSystem system, IpTablesChainSet chains, CommandParser& parserOut, Int32 version, String defaultTable)

@splitice
Copy link
Owner

splitice commented Dec 1, 2024

You load the module as the cli does under the hood (but transparently)

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

No branches or pull requests

2 participants