openwisp / netjsonconfig

Network configuration management library based on NetJSON DeviceConfiguration
https://netjsonconfig.openwisp.org/
Other
359 stars 71 forks source link

[feature] Add support for custom zerotier interface name #284

Closed Aryamanz29 closed 11 months ago

Aryamanz29 commented 1 year ago

We can customize the ZeroTier interface name in the devicemap by incorporating the OpenWRT ZeroTier configuration options config_path (which holds the devicemap path) and copy_config_path (used to copy files from a persistent location to a temporary one). To achieve this, we can include the files property within the auto_client configuration, containing a mapping of network_id to zt_interface_name (interface name). The resulting sample configuration is illustrated below:


package zerotier

config zerotier 'ow_zt'
    option config_path '/etc/ow_zerotier'
    option copy_config_path '1'
    option enabled '1'
    list join '<netowork_id>'
    option secret '<secret>'

# path: /etc/ow_zerotier/devicemap
# mode: 0644

netowork_id=owzt<last_six_hex_characters_of_nwid>