Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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 force-pushed the main branch 2 times, most recently from 4e53dea to 2619740 Compare September 28, 2023 16:51
@Adam0Brien Adam0Brien closed this Jul 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DeleteById() function
3 participants