-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iptables rules for mgmt net and bridges in both directions (#2406)
* fix iptables command direction flag * get chains for a provided family * use rule definition * fix nftables handling mgmt rules in both directions * augmented iptables check for both directions * added more debug configs * adapt iptables ruleExists check for in/out directions * added make target for building linux/amd64 * added af map * added docs * added tests for iptables rules for datapath bridges * fix chain in the test * remove testing if the fwd rules are gone, since they are not cleaned up * meh
- Loading branch information
Showing
12 changed files
with
369 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
package definitions | ||
|
||
import "errors" | ||
import ( | ||
"errors" | ||
) | ||
|
||
var ErrNotAvailable = errors.New("not available") | ||
|
||
const ( | ||
DockerUserChain = "DOCKER-USER" | ||
ForwardChain = "FORWARD" | ||
FilterTable = "filter" | ||
AcceptAction = "ACCEPT" | ||
InDirection = "in" | ||
OutDirection = "out" | ||
|
||
IPTablesRuleComment = "set by containerlab" | ||
ContainerlabComment = "set by containerlab" | ||
|
||
IPTablesCommentMaxSize = 256 | ||
) | ||
|
||
// ClabFirewall is the interface that all firewall clients must implement. | ||
type ClabFirewall interface { | ||
DeleteForwardingRules(inInterface, outInterface, chain string) error | ||
InstallForwardingRules(inInterface, outInterface, chain string) error | ||
DeleteForwardingRules(rule FirewallRule) error | ||
InstallForwardingRules(rule FirewallRule) error | ||
Name() string | ||
} | ||
|
||
type FirewallRule struct { | ||
Chain string | ||
Table string | ||
Interface string | ||
Direction string | ||
Action string | ||
Comment string | ||
} |
Oops, something went wrong.