code: def get_default_net_device():
      
      with open('/proc/net/route') as fh:
          for line in fh:
              iface, dest, _ = line.split(None, 2)
              if dest == '00000000':
                  return iface
      return None
docs: Find the device where the default route is.