You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

322 lines
7.9 KiB

  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <topology xmlns="http://www.cisco.com/VIRL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="0.9" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
  3. <extensions>
  4. <entry key="management_network" type="String">exclusive</entry>
  5. </extensions>
  6. <node name="cumulusvx-1" type="SIMPLE" subtype="CumulusVX" location="386,146">
  7. <extensions>
  8. <entry key="config" type="String">#!/bin/bash&#xD;
  9. &#xD;
  10. # vars&#xD;
  11. IP="10.0.0.1"&#xD;
  12. HOSTNAME="cumulusvx-1"&#xD;
  13. &#xD;
  14. # test touch&#xD;
  15. touch /tmp/cumulusvx-config&#xD;
  16. &#xD;
  17. # add VIRL user&#xD;
  18. useradd -m cisco -s /bin/bash&#xD;
  19. echo "cisco:cisco" | chpasswd&#xD;
  20. addgroup cisco sudo&#xD;
  21. &#xD;
  22. # set hostname&#xD;
  23. echo "$IP $HOSTNAME" &gt;&gt;/etc/hosts&#xD;
  24. echo "$HOSTNAME" &gt;/etc/hostname&#xD;
  25. hostname $HOSTNAME&#xD;
  26. &#xD;
  27. # add network interface config&#xD;
  28. cat &lt;&lt; EOF &gt;&gt;/etc/network/interfaces&#xD;
  29. &#xD;
  30. auto lo:1&#xD;
  31. iface lo:1&#xD;
  32. address $IP/32&#xD;
  33. &#xD;
  34. auto swp1&#xD;
  35. iface swp1&#xD;
  36. address $IP/32&#xD;
  37. &#xD;
  38. auto swp2&#xD;
  39. iface swp2&#xD;
  40. address $IP/32&#xD;
  41. EOF&#xD;
  42. &#xD;
  43. ifup -a&#xD;
  44. &#xD;
  45. # add ospf daemon to quagga&#xD;
  46. sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons&#xD;
  47. sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons&#xD;
  48. service quagga restart&#xD;
  49. &#xD;
  50. # add quagga config&#xD;
  51. cat &lt;&lt; EOF &gt; /etc/quagga/Quagga.conf&#xD;
  52. hostname $HOSTNAME&#xD;
  53. log file /var/log/quagga/ospfd.log&#xD;
  54. log timestamp precision 6&#xD;
  55. username cumulus nopassword&#xD;
  56. !&#xD;
  57. service integrated-vtysh-config&#xD;
  58. !&#xD;
  59. password cn321&#xD;
  60. enable password cn321&#xD;
  61. !&#xD;
  62. interface swp1&#xD;
  63. ip ospf network point-to-point&#xD;
  64. !&#xD;
  65. interface swp2&#xD;
  66. ip ospf network point-to-point&#xD;
  67. !&#xD;
  68. router ospf&#xD;
  69. ospf router-id $IP&#xD;
  70. network $IP/32 area 0.0.0.0&#xD;
  71. !&#xD;
  72. line vty&#xD;
  73. !&#xD;
  74. EOF&#xD;
  75. &#xD;
  76. service quagga restart</entry>
  77. </extensions>
  78. <interface id="0" name="swp1"/>
  79. <interface id="1" name="swp2"/>
  80. </node>
  81. <node name="cumulusvx-2" type="SIMPLE" subtype="CumulusVX" location="629,146">
  82. <extensions>
  83. <entry key="config" type="String">#!/bin/bash&#xD;
  84. &#xD;
  85. # vars&#xD;
  86. IP="10.0.0.2"&#xD;
  87. HOSTNAME="cumulusvx-2"&#xD;
  88. &#xD;
  89. # test touch&#xD;
  90. touch /tmp/cumulusvx-config&#xD;
  91. &#xD;
  92. # add VIRL user&#xD;
  93. useradd -m cisco -s /bin/bash&#xD;
  94. echo "cisco:cisco" | chpasswd&#xD;
  95. addgroup cisco sudo&#xD;
  96. &#xD;
  97. # set hostname&#xD;
  98. echo "$IP $HOSTNAME" &gt;&gt;/etc/hosts&#xD;
  99. echo "$HOSTNAME" &gt;/etc/hostname&#xD;
  100. hostname $HOSTNAME&#xD;
  101. &#xD;
  102. # add network interface config&#xD;
  103. cat &lt;&lt; EOF &gt;&gt;/etc/network/interfaces&#xD;
  104. &#xD;
  105. auto lo:1&#xD;
  106. iface lo:1&#xD;
  107. address $IP/32&#xD;
  108. &#xD;
  109. auto swp1&#xD;
  110. iface swp1&#xD;
  111. address $IP/32&#xD;
  112. &#xD;
  113. auto swp2&#xD;
  114. iface swp2&#xD;
  115. address $IP/32&#xD;
  116. EOF&#xD;
  117. &#xD;
  118. ifup -a&#xD;
  119. &#xD;
  120. # add ospf daemon to quagga&#xD;
  121. sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons&#xD;
  122. sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons&#xD;
  123. service quagga restart&#xD;
  124. &#xD;
  125. # add quagga config&#xD;
  126. cat &lt;&lt; EOF &gt; /etc/quagga/Quagga.conf&#xD;
  127. hostname $HOSTNAME&#xD;
  128. log file /var/log/quagga/ospfd.log&#xD;
  129. log timestamp precision 6&#xD;
  130. username cumulus nopassword&#xD;
  131. !&#xD;
  132. service integrated-vtysh-config&#xD;
  133. !&#xD;
  134. password cn321&#xD;
  135. enable password cn321&#xD;
  136. !&#xD;
  137. interface swp1&#xD;
  138. ip ospf network point-to-point&#xD;
  139. !&#xD;
  140. interface swp2&#xD;
  141. ip ospf network point-to-point&#xD;
  142. !&#xD;
  143. router ospf&#xD;
  144. ospf router-id $IP&#xD;
  145. network $IP/32 area 0.0.0.0&#xD;
  146. !&#xD;
  147. line vty&#xD;
  148. !&#xD;
  149. EOF&#xD;
  150. &#xD;
  151. service quagga restart</entry>
  152. </extensions>
  153. <interface id="0" name="swp1"/>
  154. <interface id="1" name="swp2"/>
  155. </node>
  156. <node name="cumulusvx-3" type="SIMPLE" subtype="CumulusVX" location="629,275">
  157. <extensions>
  158. <entry key="config" type="String">#!/bin/bash&#xD;
  159. &#xD;
  160. # vars&#xD;
  161. IP="10.0.0.3"&#xD;
  162. LEAF_IP="10.21.0.1"&#xD;
  163. HOSTNAME="cumulusvx-3"&#xD;
  164. &#xD;
  165. # test touch&#xD;
  166. touch /tmp/cumulusvx-config&#xD;
  167. &#xD;
  168. # add VIRL user&#xD;
  169. useradd -m cisco -s /bin/bash&#xD;
  170. echo "cisco:cisco" | chpasswd&#xD;
  171. addgroup cisco sudo&#xD;
  172. &#xD;
  173. # set hostname&#xD;
  174. echo "$IP $HOSTNAME" &gt;&gt;/etc/hosts&#xD;
  175. echo "$HOSTNAME" &gt;/etc/hostname&#xD;
  176. hostname $HOSTNAME&#xD;
  177. &#xD;
  178. # add network interface config&#xD;
  179. cat &lt;&lt; EOF &gt;&gt;/etc/network/interfaces&#xD;
  180. &#xD;
  181. auto lo:1&#xD;
  182. iface lo:1&#xD;
  183. address $IP/32&#xD;
  184. &#xD;
  185. auto lo:2&#xD;
  186. iface lo:2&#xD;
  187. address $LEAF_IP/24&#xD;
  188. &#xD;
  189. auto swp1&#xD;
  190. iface swp1&#xD;
  191. address $IP/32&#xD;
  192. &#xD;
  193. auto swp2&#xD;
  194. iface swp2&#xD;
  195. address $IP/32&#xD;
  196. EOF&#xD;
  197. &#xD;
  198. ifup -a&#xD;
  199. &#xD;
  200. # add ospf daemon to quagga&#xD;
  201. sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons&#xD;
  202. sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons&#xD;
  203. service quagga restart&#xD;
  204. &#xD;
  205. # add quagga config&#xD;
  206. cat &lt;&lt; EOF &gt; /etc/quagga/Quagga.conf&#xD;
  207. hostname $HOSTNAME&#xD;
  208. log file /var/log/quagga/ospfd.log&#xD;
  209. log timestamp precision 6&#xD;
  210. username cumulus nopassword&#xD;
  211. !&#xD;
  212. service integrated-vtysh-config&#xD;
  213. !&#xD;
  214. password cn321&#xD;
  215. enable password cn321&#xD;
  216. !&#xD;
  217. interface swp1&#xD;
  218. ip ospf network point-to-point&#xD;
  219. !&#xD;
  220. interface swp2&#xD;
  221. ip ospf network point-to-point&#xD;
  222. !&#xD;
  223. router ospf&#xD;
  224. ospf router-id $IP&#xD;
  225. network $IP/32 area 0.0.0.0&#xD;
  226. network $LEAF_IP/24 area 0.0.0.0&#xD;
  227. !&#xD;
  228. line vty&#xD;
  229. !&#xD;
  230. EOF&#xD;
  231. &#xD;
  232. service quagga restart</entry>
  233. </extensions>
  234. <interface id="0" name="swp1"/>
  235. <interface id="1" name="swp2"/>
  236. </node>
  237. <node name="cumulusvx-4" type="SIMPLE" subtype="CumulusVX" location="386,275">
  238. <extensions>
  239. <entry key="config" type="String">#!/bin/bash&#xD;
  240. &#xD;
  241. # vars&#xD;
  242. IP="10.0.0.4"&#xD;
  243. LEAF_IP="10.11.0.1"&#xD;
  244. HOSTNAME="cumulusvx-4"&#xD;
  245. &#xD;
  246. # test touch&#xD;
  247. touch /tmp/cumulusvx-config&#xD;
  248. &#xD;
  249. # add VIRL user&#xD;
  250. useradd -m cisco -s /bin/bash&#xD;
  251. echo "cisco:cisco" | chpasswd&#xD;
  252. addgroup cisco sudo&#xD;
  253. &#xD;
  254. # set hostname&#xD;
  255. echo "$IP $HOSTNAME" &gt;&gt;/etc/hosts&#xD;
  256. echo "$HOSTNAME" &gt;/etc/hostname&#xD;
  257. hostname $HOSTNAME&#xD;
  258. &#xD;
  259. # add network interface config&#xD;
  260. cat &lt;&lt; EOF &gt;&gt;/etc/network/interfaces&#xD;
  261. &#xD;
  262. auto lo:1&#xD;
  263. iface lo:1&#xD;
  264. address $IP/32&#xD;
  265. &#xD;
  266. auto lo:2&#xD;
  267. iface lo:2&#xD;
  268. address $LEAF_IP/24&#xD;
  269. &#xD;
  270. auto swp1&#xD;
  271. iface swp1&#xD;
  272. address $IP/32&#xD;
  273. &#xD;
  274. auto swp2&#xD;
  275. iface swp2&#xD;
  276. address $IP/32&#xD;
  277. EOF&#xD;
  278. &#xD;
  279. ifup -a&#xD;
  280. &#xD;
  281. # add ospf daemon to quagga&#xD;
  282. sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons&#xD;
  283. sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons&#xD;
  284. service quagga restart&#xD;
  285. &#xD;
  286. # add quagga config&#xD;
  287. cat &lt;&lt; EOF &gt; /etc/quagga/Quagga.conf&#xD;
  288. hostname $HOSTNAME&#xD;
  289. log file /var/log/quagga/ospfd.log&#xD;
  290. log timestamp precision 6&#xD;
  291. username cumulus nopassword&#xD;
  292. !&#xD;
  293. service integrated-vtysh-config&#xD;
  294. !&#xD;
  295. password cn321&#xD;
  296. enable password cn321&#xD;
  297. !&#xD;
  298. interface swp1&#xD;
  299. ip ospf network point-to-point&#xD;
  300. !&#xD;
  301. interface swp2&#xD;
  302. ip ospf network point-to-point&#xD;
  303. !&#xD;
  304. router ospf&#xD;
  305. ospf router-id $IP&#xD;
  306. network $IP/32 area 0.0.0.0&#xD;
  307. network $LEAF_IP/24 area 0.0.0.0&#xD;
  308. !&#xD;
  309. line vty&#xD;
  310. !&#xD;
  311. EOF&#xD;
  312. &#xD;
  313. service quagga restart</entry>
  314. </extensions>
  315. <interface id="0" name="swp1"/>
  316. <interface id="1" name="swp2"/>
  317. </node>
  318. <connection dst="/virl:topology/virl:node[4]/virl:interface[1]" src="/virl:topology/virl:node[1]/virl:interface[1]"/>
  319. <connection dst="/virl:topology/virl:node[3]/virl:interface[1]" src="/virl:topology/virl:node[1]/virl:interface[2]"/>
  320. <connection dst="/virl:topology/virl:node[3]/virl:interface[2]" src="/virl:topology/virl:node[2]/virl:interface[1]"/>
  321. <connection dst="/virl:topology/virl:node[4]/virl:interface[2]" src="/virl:topology/virl:node[2]/virl:interface[2]"/>
  322. </topology>