From dd58a6905e7ec0f6890ca2646b9baea292882ae2 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 2 Oct 2023 23:02:56 +0200 Subject: [PATCH] vlanm script improved --- vlanm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlanm b/vlanm index 30b3be6..0c5bf5e 100755 --- a/vlanm +++ b/vlanm @@ -62,7 +62,7 @@ if __name__ == "__main__": print("Remove rule:", UID_O) if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']: if rn is None: - my_cmd = ['sudo', '-S', 'iptables', '-A', 'FORWARD', '-j', 'ACCEPT', '-i', device_by_vlan(args.vlan_number), '-o', 'eth0', '!', '-d', '192.168.0.0/16', '-m', 'comment', '--comment', UID_O] + my_cmd = ['sudo', '-S', 'iptables', '-A', 'FORWARD', '-j', 'ACCEPT', '-i', device_by_vlan(args.vlan_number), '-o', device_by_vlan(10), '!', '-d', '192.168.0.0/16', '-m', 'comment', '--comment', UID_O] cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",) print(cmd.stdout) else: @@ -79,7 +79,7 @@ if __name__ == "__main__": print("Remove rule:", UID_L) if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']: if rn is None: - my_cmd = ['sudo', '-S', 'iptables', '-A', 'FORWARD', '-j', 'LOG', '-i', device_by_vlan(args.vlan_number), '-o', 'eth0', '!', '-d', '192.168.0.0/16', '-m', 'comment', '--comment', UID_L] + my_cmd = ['sudo', '-S', 'iptables', '-A', 'FORWARD', '-j', 'LOG', '-i', device_by_vlan(args.vlan_number), '-o', device_by_vlan(10), '!', '-d', '192.168.0.0/16', '-m', 'comment', '--comment', UID_L] cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",) print(cmd.stdout) print("Use 'sudo ~/bin/ftail /var/log/kern.log' to view the logs.")