@@ -317,7 +317,7 @@ def set_local_rules(resolver):
317317else :
318318 print ("Missing /opt/openziti/etc/ebpf_config.json can't set ebpf interface config" )
319319 sys .exit (1 )
320-
320+ resolver = get_if_ip ( lanIf )
321321ingress_object_file = '/opt/openziti/bin/zfw_tc_ingress.o'
322322egress_object_file = '/opt/openziti/bin/zfw_tc_outbound_track.o'
323323status = subprocess .run (['/opt/openziti/bin/zfw' , '-L' , '-E' ], stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
@@ -365,6 +365,8 @@ def set_local_rules(resolver):
365365 continue
366366 else :
367367 print ("Attached " + egress_object_file + " to " + e )
368+ if (len (resolver )):
369+ set_local_rules (resolver )
368370 if (os .path .exists ("/opt/openziti/bin/user/user_rules.sh" )):
369371 print ("Adding user defined rules" )
370372 os .system ("/opt/openziti/bin/user/user_rules.sh" )
@@ -408,13 +410,12 @@ def set_local_rules(resolver):
408410 print ("Cant attach " + e + " to tc egress with " + egress_object_file )
409411 else :
410412 print ("Attached " + egress_object_file + " to " + e )
413+ if (len (resolver )):
414+ set_local_rules (resolver )
411415 if (os .path .exists ("/opt/openziti/bin/user/user_rules.sh" )):
412416 print ("Adding user defined rules!" )
413417 os .system ("/opt/openziti/bin/user/user_rules.sh" )
414418
415- resolver = get_if_ip (lanIf )
416- if (len (resolver )):
417- set_local_rules (resolver )
418419if (os .path .exists ('/etc/systemd/system/ziti-router.service' ) and router_config ):
419420 unconfigured = os .system ("grep -r 'ExecStartPre\=\-\/opt/openziti\/bin\/start_ebpf_router.py' /etc/systemd/system/ziti-router.service" )
420421 if (unconfigured ):
0 commit comments