Skip to content

Commit 5c5ca59

Browse files
authored
Merge pull request #89 from netfoundry/v0.9.8-release-candidate
Modified startup scripts for router and controller deployments
2 parents 7584a22 + 1245f38 commit 5c5ca59

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format
55
---
66
###
77

8+
# [0.9.8] - 2025-2-4
9+
10+
- Modified start_ebpf_router.py and start_ebpf_controller.py scripts so that if the user_rules.sh file
11+
exists it can override the default port settings set based on the respective config file.
12+
13+
###
14+
815
# [0.9.7] - 2024-12-16
916

1017
- added debug option to the pr worklow for checking version tested

files/scripts/start_ebpf_controller.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def set_local_rules(ip):
377377
else:
378378
print("Missing /opt/openziti/etc/ebpf_config.json can't set ebpf interface config")
379379
sys.exit(1)
380-
380+
lanIp = get_if_ip(lanIf)
381381
ingress_object_file = '/opt/openziti/bin/zfw_tc_ingress.o'
382382
egress_object_file = '/opt/openziti/bin/zfw_tc_outbound_track.o'
383383
status = subprocess.run(['/opt/openziti/bin/zfw', '-L', '-E'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
@@ -427,6 +427,9 @@ def set_local_rules(ip):
427427
continue
428428
else:
429429
print("Attached " + egress_object_file + " to " + e)
430+
431+
if(len(lanIp)):
432+
set_local_rules(lanIp)
430433
if(os.path.exists("/opt/openziti/bin/user/user_rules.sh")):
431434
print("Adding user defined rules")
432435
os.system("/opt/openziti/bin/user/user_rules.sh")
@@ -470,6 +473,8 @@ def set_local_rules(ip):
470473
print("Cant attach " + e + " to tc egress with " + egress_object_file)
471474
else:
472475
print("Attached " + egress_object_file + " to " + e)
476+
if(len(lanIp)):
477+
set_local_rules(lanIp)
473478
if(os.path.exists("/opt/openziti/bin/user/user_rules.sh")):
474479
print("Adding user defined rules!")
475480
os.system("/opt/openziti/bin/user/user_rules.sh")

files/scripts/start_ebpf_router.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def set_local_rules(resolver):
317317
else:
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)
321321
ingress_object_file = '/opt/openziti/bin/zfw_tc_ingress.o'
322322
egress_object_file = '/opt/openziti/bin/zfw_tc_outbound_track.o'
323323
status = 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)
418419
if(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):

src/zfw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ char *direction_string;
263263
char *masq_interface;
264264
char check_alt[IF_NAMESIZE];
265265

266-
const char *argp_program_version = "0.9.7";
266+
const char *argp_program_version = "0.9.8";
267267
struct ring_buffer *ring_buffer;
268268

269269
__u32 if_list[MAX_IF_LIST_ENTRIES];

src/zfw_monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ char check_alt[IF_NAMESIZE];
8787
char doc[] = "zfw_monitor -- ebpf firewall monitor tool";
8888
const char *rb_map_path = "/sys/fs/bpf/tc/globals/rb_map";
8989
const char *tproxy_map_path = "/sys/fs/bpf/tc/globals/zt_tproxy_map";
90-
const char *argp_program_version = "0.9.7";
90+
const char *argp_program_version = "0.9.8";
9191
union bpf_attr rb_map;
9292
int rb_fd = -1;
9393

0 commit comments

Comments
 (0)