|
|
|
|
62
|
print("Remove rule:", UID_O)
|
62
|
print("Remove rule:", UID_O)
|
63
|
if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']:
|
63
|
if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']:
|
64
|
if rn is None:
|
64
|
if rn is None:
|
65
|
- 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]
|
|
|
|
|
65
|
+ 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]
|
66
|
cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",)
|
66
|
cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",)
|
67
|
print(cmd.stdout)
|
67
|
print(cmd.stdout)
|
68
|
else:
|
68
|
else:
|
|
|
|
|
79
|
print("Remove rule:", UID_L)
|
79
|
print("Remove rule:", UID_L)
|
80
|
if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']:
|
80
|
if getpass('Proceed? [Y/n]') in ['', 'y', 'Y']:
|
81
|
if rn is None:
|
81
|
if rn is None:
|
82
|
- 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]
|
|
|
|
|
82
|
+ 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]
|
83
|
cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",)
|
83
|
cmd = subprocess.run(my_cmd, stdout=subprocess.PIPE, input=password, encoding="ascii",)
|
84
|
print(cmd.stdout)
|
84
|
print(cmd.stdout)
|
85
|
print("Use 'sudo ~/bin/ftail /var/log/kern.log' to view the logs.")
|
85
|
print("Use 'sudo ~/bin/ftail /var/log/kern.log' to view the logs.")
|