Skip to content

Instantly share code, notes, and snippets.

@pandada8
Created May 16, 2016 10:18
Show Gist options
  • Save pandada8/9ab2c0e5c1fcee36af84f9386ec5ecf5 to your computer and use it in GitHub Desktop.
Save pandada8/9ab2c0e5c1fcee36af84f9386ec5ecf5 to your computer and use it in GitHub Desktop.
setup zerotier
import requests
requests.post("http://127.0.0.1:9993/controller/network/##########000001", json={
"name": "test",
"private": True,
"enableBroadcast": False,
"allowPassiveBridging": False,
"v4AssignMode": "zt",
"v6AssignMode": "none",
"multicastLimit": 24,
"ipLocalRoutes": ["192.168.233.0/16"],
"ipAssignmentPools": [{"ipRangeStart": "192.168.233.1", "ipRangeEnd": "192.168.233.254"}],
"relays": [{"address": "##########", "phyAddress": "<ip>/<port>"}],
"rules": [{"ruleNo": 999, "action": "accept"}] # allow all traffic
}, headers={"X-ZT1-Auth": "<ignored>"})
requests.post("http://127.0.0.1:9993/controller/network/##########000001/member/##########", headers={"X-ZT1-Auth": "<ignored>"}, json={
"authorized": True,
"activeBridge": False,
"ipAssignments": ["192.168.233.3/24"]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment