fix: firewall: add comments for iptable rules

Signed-off-by: zhihui.ding <danieldin186@gmail.com>
This commit is contained in:
zhihui.ding
2023-08-24 22:11:56 +08:00
parent d118d36039
commit b2ee3d9b2e
4 changed files with 41 additions and 30 deletions

View File

@@ -92,6 +92,9 @@ func (ru IpRule) Args() []string {
if ru.Output != "" {
args = append(args, "-o", ru.Output)
}
if ru.Comment != "" {
args = append(args, "-m", "comment", "--comment", ru.Comment)
}
if ru.Jump != "" {
jump := strings.ToUpper(ru.Jump)
if jump == "DROP" || jump == "ACCEPT" {