9

Is there any more or less standard/spec that is, vendor neutral, for network configuration language? Say, a VPC with networks and virtual machines would become an XML or JSON file.

Something like,

<deployment>
<vpc name="Test">
<appliances>
  <vm id="1" />
</appliances>
</vpc>
</deployment>
3
  • No, not really. The problem is that not every vendor supports everything, and they all do it differently. This has been a goal for a long time, but it has proved to be very difficult. In any case, VPCs and VMs are off-topic here.
    – Ron Maupin
    Feb 5 '19 at 15:28
  • Do you want to document the network or use this as a data source to automate network configuration?
    – JFL
    Feb 5 '19 at 17:16
  • @JFL ideally, both
    – J. Doe
    Feb 5 '19 at 17:31
10

YANG is the answer here. To quote from RFC8345, which defines YANG:

This document defines an abstract (generic, or base) YANG data model for network/service topologies and inventories. The data model serves as a base model that is augmented with technology-specific details in other, more specific topology and inventory data models.

Protocols like NETCONF can use YANG for representations of network configurations.

1
  • I ran across this from nearly two years ago. The current direction is now YAML and Ansible. Perhaps, one day, everyone will settle on something. I have been hearing for a long time that all vendors should be running SONiC as the network OS.
    – Ron Maupin
    Jan 3 at 5:35
4

Hashicorp's Terraform has a vendor-neutral (but not -agnostic) configuration language. AWS VPCs look like:

resource "aws_vpc" "Test" {
  cidr_block       = "10.0.0.0/16"
  instance_tenancy = "dedicated"

  tags = {
    Name = "Test"
  }
}
3

Ansible can be used to build (part of) a network as code. It uses YAML syntax and can read JSON.

There's existing ansible roles for major vendor's equipment's, and you can build your own roles.

But existing roles are not always up to date and writing, and maintaining, your own can be time consuming.

3

For AWS VPCs specifically, you can use CloudFormation to generate a "configuration" file, which can be used to recreate the VPC and all the related components. I believe it's in JSON format.

For networks in general, there is no such thing. Figure out how to do it, and you can retire comfortably.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.