@@ -486,14 +486,14 @@ func (c *Controller) setIptables() error {
486
486
continue
487
487
}
488
488
489
- var kubeProxyIpsetProtocol , matchset string
489
+ var kubeProxyIpsetProtocol , matchset , nodeMatchSet string
490
490
var obsoleteRules , iptablesRules []util.IPTableRule
491
491
if protocol == kubeovnv1 .ProtocolIPv4 {
492
492
iptablesRules = v4Rules
493
- matchset = "ovn40subnets"
493
+ matchset , nodeMatchSet = "ovn40subnets" , "ovn40" + OtherNodeSet
494
494
} else {
495
495
iptablesRules = v6Rules
496
- kubeProxyIpsetProtocol , matchset = "6-" , "ovn60subnets"
496
+ kubeProxyIpsetProtocol , matchset , nodeMatchSet = "6-" , "ovn60subnets" , "ovn60" + OtherNodeSet
497
497
}
498
498
499
499
if nodeIP := nodeIPs [protocol ]; nodeIP != "" {
@@ -515,8 +515,12 @@ func (c *Controller) setIptables() error {
515
515
continue
516
516
}
517
517
rule := fmt .Sprintf ("-p %s -m addrtype --dst-type LOCAL -m set --match-set %s dst -j MARK --set-xmark 0x80000/0x80000" , p , ipset )
518
+ rule2 := fmt .Sprintf ("-p %s -m set --match-set %s src -m set --match-set %s dst -j MARK --set-xmark 0x4000/0x4000" , p , nodeMatchSet , ipset )
518
519
obsoleteRules = append (obsoleteRules , util.IPTableRule {Table : NAT , Chain : Prerouting , Rule : strings .Fields (rule )})
519
- iptablesRules = append (iptablesRules , util.IPTableRule {Table : NAT , Chain : OvnPrerouting , Rule : strings .Fields (rule )})
520
+ iptablesRules = append (iptablesRules ,
521
+ util.IPTableRule {Table : NAT , Chain : OvnPrerouting , Rule : strings .Fields (rule )},
522
+ util.IPTableRule {Table : NAT , Chain : OvnPrerouting , Rule : strings .Fields (rule2 )},
523
+ )
520
524
}
521
525
}
522
526
0 commit comments