Introduction
Circuit lets you write down how each network device should be set up. Then it makes the device match.
You keep one TypeScript file per device in a git repository. If you know Terraform or Ansible for servers, Circuit is the same idea for routers and switches.
How it works
- You describe a device in a file: its ports, VLANs, addresses, routing, firewall, and more.
circuit validatechecks the whole project.circuit diff <device>reads the device and shows what would change on it.circuit apply <device>shows the same, asks, and sends the change once you say yes. Circuit keeps the change only if it can still log in afterwards. See Make a change.- You commit the files, so git keeps who changed what, when, and why.
Principles
- The file is the whole truth. A device runs exactly what its file says. Circuit turns off a port the file doesn't write, removes a user it doesn't list, and turns off a service it doesn't turn on.
- Leave a field out to turn it off. You write only what is on. There is no
enabled: false. - The same words for every vendor. You write
access_vlanorssh, and each device gets its own vendor's commands. If a device can't do what you wrote,circuit validatesays so, and Circuit sends nothing. - Names are checked as you type. Every VLAN, interface, policy, and port you use must exist on that device. Your editor shows a typo as an error.
- Nothing is filled in for you. Circuit writes no default and no description that you didn't write. It may warn, but it never fills in.
- Secrets are encrypted. A password is
secret("NAME")in the file, and its value is encrypted in.circuit/secrets. See Secrets. - Standards first. What Circuit ships, such as BGP roles or the bogon list, follows an RFC, IANA, or another published source. See Standards. Your network's own choices stay in your project.
Which devices
Circuit works with MikroTik RouterOS, Huawei VRP, Raisecom ROS, Juniper Junos, and Fortinet FortiOS. See Platforms for the versions and what works on each.
If some words are new to you, see the Glossary.