Skip to content
Snippets Groups Projects
Commit 540eb8b4 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix not run initiate.sh

parent 3122ced5
No related branches found
No related tags found
No related merge requests found
# import os
# import sys
# import subprocess
import subprocess
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
# from netfilterqueue import NetfilterQueue
......@@ -35,10 +35,13 @@ DIR = "/home/node/Desktop/gns3_unikernel_testbed"
def main():
subprocess.run(f"sudo {DIR}/ubuntu_intermediate/./initiate.sh", shell=True, check=True)
print("./initiate is executed")
b = BPF(src_file=f"inter_op_ebpf.c")
fn = b.load_func("inter_op_ebpf", BPF.XDP)
for inter_num in range(3, 13):
for inter_num in range(2, 13):
inter_name = f"ens{inter_num + 1}"
b.attach_xdp(inter_name, fn, 0)
print("Attach the ebpf program at", inter_name)
......@@ -57,8 +60,7 @@ def main():
# subprocess.run(rule_check, shell=True, check=True)
# print("Rule already exists, no need to add it.")
# except subprocess.CalledProcessError:
# subprocess.run(f"sudo {DIR}/ubuntu_intermediate/./initiate.sh", shell=True, check=True)
# print("./initiate is executed")
# try:
# rule_1 = "sudo iptables -I FORWARD -i br0 -j NFQUEUE --queue-num 1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment