Netkit compiler

Generate Netkit configuration files for a network

class AutoNetkit.compiler.netkitcompiler.NetkitCompiler(network, services, zebra_password='1234')[source]

Compiler main

configure()[source]

Configure Netkit

configure_bgp()[source]

Generates BGP specific configuration files

configure_dns()[source]

Generates BIND configuration files for DNS

Can check configs eg:

Forward:

bash-3.2$ named-checkzone -d AS3 ank_lab/netkit_lab/AS3_l3_3_dns_1/etc/bind/db.AS3
loading "AS3" from "ank_lab/netkit_lab/AS3_l3_3_dns_1/etc/bind/db.AS3" class "IN"
zone AS3/IN: loaded serial 2008080101
OK

Reverse:

bash-3.2$ named-checkzone -d 0.10.in-addr.arpa ank_lab/netkit_lab/AS3_l3_3_dns_1/etc/bind/db.0.10.in-addr.arpa. 
loading "0.10.in-addr.arpa" from "ank_lab/netkit_lab/AS3_l3_3_dns_1/etc/bind/db.0.10.in-addr.arpa." class "IN"
zone 0.10.in-addr.arpa/IN: loaded serial 2008080101
OK

named:

bash-3.2$ named-checkconf ank_lab/netkit_lab/AS3_l3_3_dns_1/etc/bind/named.conf 
configure_igp()[source]

Generates IGP specific configuration files (eg ospfd)

configure_netkit()[source]

Generates Netkit and Zebra/Quagga specific configuration files.

initialise()[source]

Creates lab folder structure

AutoNetkit.compiler.netkitcompiler.bind_dir(network, rtr)[source]

Returns bind path for router rtr

AutoNetkit.compiler.netkitcompiler.dot_ssh_dir(network, rtr)[source]

Returns .ssh path for router rtr

AutoNetkit.compiler.netkitcompiler.etc_dir(network, rtr)[source]

Returns etc path for router rtr

AutoNetkit.compiler.netkitcompiler.lo_interface(int_id=0)[source]

Returns Linux format lo_interface id for int_id

AutoNetkit.compiler.netkitcompiler.netkit_dir(network, rtr)[source]

Returns Netkit path

AutoNetkit.compiler.netkitcompiler.root_dir(network, rtr)[source]

Returns root path for router rtr

AutoNetkit.compiler.netkitcompiler.router_dir(network, rtr)[source]

Returns path for router rtr

AutoNetkit.compiler.netkitcompiler.sshd_dir(network, rtr)[source]

Returns formatted ssh path

AutoNetkit.compiler.netkitcompiler.zebra_dir(network, rtr)[source]

Returns formatted Zebra path