@@ -17,8 +17,8 @@ built in to python that format is always supported. Additionally YAML and TOML
17
17
are supported if the corresponding packages are available (i.e., ~PyYAML~ and
18
18
~toml~).
19
19
20
- The config itself is defined with a YANG model which is defined in the following
21
- sections.
20
+ The config itself is defined with a YANG model which is defined in the
21
+ subsequent sections.
22
22
23
23
** Config Tree
24
24
@@ -132,6 +132,85 @@ module: labn-munet-config
132
132
#+end_example
133
133
134
134
135
+ ** Examples
136
+ *** Router VM
137
+
138
+ Router VMs are very different from standard unix-like OSs. Munet does a lot of
139
+ automatic configuration assuming a unix-like (and mostly Linux) OS. Various
140
+ configuration parameters need to be set to tune the automatic configuration and
141
+ assumptions down. Here's an example munet config fragment that shows booting a
142
+ cisco VM using a nexos file system image.
143
+
144
+ #+begin_src yaml
145
+ topology:
146
+ networks-autonumber: true
147
+ dns-network: "mgmt0"
148
+ networks:
149
+ - name: mgmt0
150
+ ip: 192.168.0.254/24
151
+ nat: true
152
+ - name: net0
153
+ nodes:
154
+ # ...
155
+ - name: r1
156
+ kind: cisco
157
+ connections:
158
+ - to: "mgmt0"
159
+ name: "eth1"
160
+ driver: "e1000"
161
+ - to: "net0"
162
+ name: "eth2"
163
+ driver: "e1000"
164
+ kinds:
165
+ - name: cisco
166
+ shell: false
167
+ cmd: |
168
+ terminal terminal-type dumb
169
+ terminal length 0
170
+ terminal width 511
171
+ terminal session 0
172
+ conf t
173
+ line console
174
+ exec-timeout 0
175
+ line vty
176
+ exec-timeout 0
177
+ int mgmt0
178
+ ip address 192.168.0.2/24
179
+ exit
180
+ feature ssh
181
+ feature telnet
182
+ end
183
+ qemu:
184
+ unix-os: false
185
+ disk: "%CONFIGDIR%/nexus9300v64.10.2.3.F.qcow2"
186
+ bios: "open-firmware"
187
+ memory: "8192M"
188
+ smp: 2
189
+ kvm: true
190
+ console:
191
+ stdio: false
192
+ user: "admin"
193
+ password: ""
194
+ prompt: "(^|\r?\n\r?)switch(\\([^\\)]+\\))?#"
195
+ expects:
196
+ - "skip - bypass.*yes/skip/no\\)\\[no\\]:"
197
+ - "loader > "
198
+ sends:
199
+ - "skip\n"
200
+ - "boot nxos64-cs.10.2.3.F.bin\n"
201
+ timeout: 900
202
+
203
+ cli:
204
+ commands:
205
+ - name: ssh
206
+ exec: "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null admin@%IPADDR%"
207
+ kinds: ["cisco"]
208
+ format: "ssh NODE [NODE ...]"
209
+ top-level: true
210
+ new-window: true
211
+ #+end_src
212
+
213
+
135
214
** Config Model
136
215
137
216
#+NAME: test-validate-module
@@ -533,7 +612,8 @@ module: labn-munet-config
533
612
description
534
613
"If true the command is run in the top-level containing namespace.
535
614
This is the namespace from which each of the hosts allocated
536
- sub-namespaces from. or a host namespace.";
615
+ sub-namespaces from. Multple hosts are still allowed and their
616
+ variables will be substituted accordingly.";
537
617
}
538
618
}
539
619
}
0 commit comments