Skip to content

Commit bf4ab32

Browse files
committed
doc: document configuration requirements for a router VM setup
1 parent 46dfa6e commit bf4ab32

File tree

1 file changed

+83
-3
lines changed

1 file changed

+83
-3
lines changed

README.org

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ built in to python that format is always supported. Additionally YAML and TOML
1717
are supported if the corresponding packages are available (i.e., ~PyYAML~ and
1818
~toml~).
1919

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.
2222

2323
** Config Tree
2424

@@ -132,6 +132,85 @@ module: labn-munet-config
132132
#+end_example
133133

134134

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+
135214
** Config Model
136215

137216
#+NAME: test-validate-module
@@ -533,7 +612,8 @@ module: labn-munet-config
533612
description
534613
"If true the command is run in the top-level containing namespace.
535614
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.";
537617
}
538618
}
539619
}

0 commit comments

Comments
 (0)