fea: switch: support router network

This commit is contained in:
Daniel Ding
2023-09-26 15:30:04 +08:00
parent baec14f05e
commit a15a737e2c
11 changed files with 356 additions and 158 deletions

View File

@@ -47,6 +47,7 @@ type IpRule struct {
SetMss int
Order string
Match string
CtState string
TcpFlag []string
}
@@ -81,6 +82,9 @@ func (ru IpRule) Args() []string {
args = append(args, "!")
args = append(args, "-m", "set", "--match-set", ru.NoDestSet, "dst")
}
if ru.CtState != "" {
args = append(args, "-m", "conntrack", "--ctstate", ru.CtState)
}
if ru.Proto != "" {
args = append(args, "-p", ru.Proto)
}