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

feat: add DeleteById function #112

Closed
wants to merge 1 commit into from
Closed

Conversation

Adam0Brien
Copy link
Member

Fix: #97
feat: users now have the option to delete a specific rule.

Rule numbers can be found by using the following command:
sudo iptables -t nat -L PREROUTING -n --line-number

Example usage:

        table := "nat"
	chain := "PREROUTING"
	ruleIDToDelete := 2

	// Use the DeleteById function to delete the rule.
	result, err := iptables.DeleteById(table, chain, ruleIDToDelete)
	if err != nil {
		fmt.Printf("Error: %v\n", err)
	} else {
		fmt.Println(result)
	}

@Adam0Brien Adam0Brien self-assigned this Sep 19, 2023
iptables/iptables.go Outdated Show resolved Hide resolved
@Adam0Brien Adam0Brien closed this Jul 11, 2024
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.

Add DeleteById() function
3 participants