Set metric to 100

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2024-12-28 15:33:46 +01:00
parent 5dbdf1e8de
commit 4e6b513fc7

View File

@ -29,7 +29,7 @@ class BTTether(plugins.Plugin):
address = f'{ip}'
gateway = '172.20.10.1'
try:
subprocess.run(['nmcli', 'connection', 'modify', f'{phone_name}', 'ipv4.addresses', f'{address}', 'ipv4.gateway',f'{gateway}'], check=True)
subprocess.run(['nmcli', 'connection', 'modify', f'{phone_name}', 'ipv4.addresses', f'{address}', 'ipv4.gateway',f'{gateway}', 'ipv4.route-metric', '100'], check=True)
subprocess.run(['nmcli', 'connection', 'reload'], check=True)
subprocess.run(['systemctl', 'restart', 'NetworkManager'], check=True)
except Exception as e: