Skip to content

Commit c54ce0d

Browse files
committed
Add openflow to drop traffic for nodePort service
1 parent e712193 commit c54ce0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

go-controller/pkg/node/gateway_shared_intf.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ func (npw *nodePortWatcher) updateServiceFlowCache(service *corev1.Service, netI
334334
fmt.Sprintf("cookie=%s, priority=110, in_port=%s, %s, tp_dst=%d, "+
335335
"actions=%s",
336336
cookie, npw.ofportPhys, flowProtocol, svcPort.NodePort, actions),
337+
// table=0, matches on service traffic towards nodePort from OVN and drops it, to prevent the traffic goes to the host
338+
fmt.Sprintf("cookie=%s, priority=110, in_port=%s, %s, tp_dst=%d, "+
339+
"actions=drop",
340+
cookie, netConfig.OfPortPatch, flowProtocol, svcPort.NodePort),
337341
// table=0, matches on return traffic from service nodePort and sends it out to primary node interface (br-ex)
338342
fmt.Sprintf("cookie=%s, priority=110, in_port=%s, dl_src=%s, %s, tp_src=%d, "+
339343
"actions=output:%s",

0 commit comments

Comments
 (0)