diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 1d0c2480..3d6616d0 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -771,7 +771,10 @@ def setSimpleConfig(modem_preset): if interface.noProto: logging.warning(f"Not starting Tunnel - disabled by noProto") else: - tunnel.Tunnel(interface, subnet=args.tunnel_net) + if args.tunnel_net: + tunnel.Tunnel(interface, subnet=args.tunnel_net) + else: + tunnel.Tunnel(interface) if args.ack or (args.dest != BROADCAST_ADDR and waitForAckNak): print( diff --git a/meshtastic/tunnel.py b/meshtastic/tunnel.py index b880efab..b3fe7d4f 100644 --- a/meshtastic/tunnel.py +++ b/meshtastic/tunnel.py @@ -49,6 +49,12 @@ def __init__(self, iface, subnet="10.115", netmask="255.255.0.0"): if not iface: raise Exception("Tunnel() must have a interface") + if not subnet: + raise Exception("Tunnel() must have a subnet") + + if not netmask: + raise Exception("Tunnel() must have a netmask") + self.iface = iface self.subnetPrefix = subnet