We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DeleteById()
I would introduce a new function:
func DeleteById(table string, chain string, id int) error { ... }
This allow you to delete a specific rule by passing its number identifier. The number is retrievable using the following (example) command:
$ sudo iptables -t nat -L PREROUTING -n --line-number Chain PREROUTING (policy ACCEPT) num target prot opt source destination 1 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:29 2 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:22 3 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:25
The text was updated successfully, but these errors were encountered:
Maybe you want to try this:
https://github.com/singchia/go-xtables https://pkg.go.dev/github.com/singchia/go-xtables/iptables#WithCommandDeleteRuleNumber
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I would introduce a new function:
This allow you to delete a specific rule by passing its number identifier.
The number is retrievable using the following (example) command:
$ sudo iptables -t nat -L PREROUTING -n --line-number Chain PREROUTING (policy ACCEPT) num target prot opt source destination 1 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:29 2 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:22 3 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1242 to:127.0.0.1:25
The text was updated successfully, but these errors were encountered: