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.

366 lines
12 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. <node name="iosv-1" type="SIMPLE" subtype="IOSv" location="185,293" ipv4="192.168.101.2">
  4. <extensions>
  5. <entry key="AutoNetkit.mgmt_ip" type="string"></entry>
  6. <entry key="AutoNetkit.IGP" type="String">eigrp</entry>
  7. <entry key="config" type="String">! IOS Config generated on 2015-09-06 21:22&#xD;
  8. ! by autonetkit_0.18.1&#xD;
  9. !&#xD;
  10. hostname iosv-1&#xD;
  11. boot-start-marker&#xD;
  12. boot-end-marker&#xD;
  13. !&#xD;
  14. vrf definition Mgmt-intf&#xD;
  15. !&#xD;
  16. address-family ipv4&#xD;
  17. exit-address-family&#xD;
  18. !&#xD;
  19. address-family ipv6&#xD;
  20. exit-address-family&#xD;
  21. !&#xD;
  22. !&#xD;
  23. !&#xD;
  24. no aaa new-model&#xD;
  25. !&#xD;
  26. !&#xD;
  27. ip cef&#xD;
  28. ipv6 unicast-routing&#xD;
  29. ipv6 cef&#xD;
  30. !&#xD;
  31. !&#xD;
  32. service timestamps debug datetime msec&#xD;
  33. service timestamps log datetime msec&#xD;
  34. no service password-encryption&#xD;
  35. no service config&#xD;
  36. enable password cisco&#xD;
  37. ip classless&#xD;
  38. ip subnet-zero&#xD;
  39. no ip domain lookup&#xD;
  40. line vty 0 4&#xD;
  41. transport input ssh telnet&#xD;
  42. exec-timeout 720 0&#xD;
  43. password cisco&#xD;
  44. login&#xD;
  45. line con 0&#xD;
  46. password cisco&#xD;
  47. !&#xD;
  48. no cdp run&#xD;
  49. !&#xD;
  50. !&#xD;
  51. interface Loopback0&#xD;
  52. description Loopback&#xD;
  53. ip address 192.168.0.2 255.255.255.255&#xD;
  54. !&#xD;
  55. interface GigabitEthernet0/0&#xD;
  56. description OOB Management&#xD;
  57. vrf forwarding Mgmt-intf&#xD;
  58. ! Configured on launch&#xD;
  59. no ip address&#xD;
  60. duplex full&#xD;
  61. speed auto&#xD;
  62. no shutdown&#xD;
  63. !&#xD;
  64. interface GigabitEthernet0/1&#xD;
  65. description to wanEM&#xD;
  66. ip address 192.168.101.2 255.255.255.0&#xD;
  67. duplex full&#xD;
  68. speed auto&#xD;
  69. no shutdown&#xD;
  70. !&#xD;
  71. interface GigabitEthernet0/2&#xD;
  72. description to server-1&#xD;
  73. ip address 192.168.1.1 255.255.255.0&#xD;
  74. duplex full&#xD;
  75. speed auto&#xD;
  76. no shutdown&#xD;
  77. !&#xD;
  78. !&#xD;
  79. !&#xD;
  80. &#xD;
  81. !&#xD;
  82. ip route 0.0.0.0 0.0.0.0 192.168.101.1&#xD;
  83. !&#xD;
  84. end&#xD;
  85. </entry>
  86. <entry key="Auto-generate config" type="Boolean">false</entry>
  87. </extensions>
  88. <interface id="0" name="GigabitEthernet0/1" ipv4="192.168.101.2" netPrefixLenV4="24"/>
  89. <interface id="1" name="GigabitEthernet0/2" ipv4="192.168.1.1" netPrefixLenV4="24"/>
  90. </node>
  91. <node name="server-1" type="SIMPLE" subtype="server" location="165,452">
  92. <extensions>
  93. <entry key="Auto-generate config" type="Boolean">false</entry>
  94. <entry key="config" type="String">#cloud-config&#xD;
  95. bootcmd:&#xD;
  96. - ln -s -t /etc/rc.d /etc/rc.local&#xD;
  97. hostname: server-1&#xD;
  98. manage_etc_hosts: true&#xD;
  99. runcmd:&#xD;
  100. - start ttyS0&#xD;
  101. - systemctl start getty@ttyS0.service&#xD;
  102. - systemctl start rc-local&#xD;
  103. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config&#xD;
  104. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
  105. - service ssh restart&#xD;
  106. - service sshd restart&#xD;
  107. users:&#xD;
  108. - default&#xD;
  109. - gecos: User configured by VIRL Configuration Engine 0.18.9&#xD;
  110. lock-passwd: false&#xD;
  111. name: cisco&#xD;
  112. plain-text-passwd: cisco&#xD;
  113. shell: /bin/bash&#xD;
  114. ssh-authorized-keys:&#xD;
  115. - VIRL-USER-SSH-PUBLIC-KEY&#xD;
  116. sudo: ALL=(ALL) ALL&#xD;
  117. write_files:&#xD;
  118. - path: /etc/init/ttyS0.conf&#xD;
  119. owner: root:root&#xD;
  120. content: |&#xD;
  121. # ttyS0 - getty&#xD;
  122. # This service maintains a getty on ttyS0 from the point the system is&#xD;
  123. # started until it is shut down again.&#xD;
  124. start on stopped rc or RUNLEVEL=[12345]&#xD;
  125. stop on runlevel [!12345]&#xD;
  126. respawn&#xD;
  127. exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
  128. permissions: '0644'&#xD;
  129. - path: /etc/systemd/system/dhclient@.service&#xD;
  130. content: |&#xD;
  131. [Unit]&#xD;
  132. Description=Run dhclient on %i interface&#xD;
  133. After=network.target&#xD;
  134. [Service]&#xD;
  135. Type=oneshot&#xD;
  136. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
  137. RemainAfterExit=yes&#xD;
  138. owner: root:root&#xD;
  139. permissions: '0644'&#xD;
  140. - path: /etc/rc.local&#xD;
  141. owner: root:root&#xD;
  142. permissions: '0755'&#xD;
  143. content: |-&#xD;
  144. #!/bin/sh -e&#xD;
  145. ifconfig eth1 up 192.168.1.100 netmask 255.255.255.0&#xD;
  146. route add -net 192.168.0.2/31 gw 192.168.1.1 dev eth1&#xD;
  147. route add -net 192.168.1.0/24 gw 192.168.1.1 dev eth1&#xD;
  148. route add -net 192.168.101.0/24 gw 192.168.1.1 dev eth1&#xD;
  149. route add -net 192.168.102.0/24 gw 192.168.1.1 dev eth1&#xD;
  150. route add -net 192.168.2.0/24 gw 192.168.1.1 dev eth1&#xD;
  151. route del default&#xD;
  152. route add default gw 192.168.1.1&#xD;
  153. exit 0&#xD;
  154. &#xD;
  155. - path: /etc/resolv.conf&#xD;
  156. owner: root:root&#xD;
  157. permissions: '0644'&#xD;
  158. content: |&#xD;
  159. #by Patrick.&#xD;
  160. nameserver 8.8.8.8&#xD;
  161. </entry>
  162. </extensions>
  163. <interface id="0" name="eth1" ipv4="192.168.1.100" netPrefixLenV4="24"/>
  164. </node>
  165. <node name="wanEM" type="SIMPLE" subtype="wanEM" location="340,139" vmImage="fdai4298-wanEM-bash-init [b7b5b189-12e6-4c87-a3c6-6d736ba6522c]" vmFlavor="m1.small [2]">
  166. <extensions>
  167. <entry key="Auto-generate config" type="Boolean">false</entry>
  168. <entry key="config" type="String"> ifconfig eth1 up 192.168.101.1 netmask 255.255.255.0&#xD;
  169. ifconfig eth2 up 192.168.102.1 netmask 255.255.255.0&#xD;
  170. &#xD;
  171. &#xD;
  172. dhclient eth0&#xD;
  173. dhclient eth3&#xD;
  174. &#xD;
  175. &#xD;
  176. route add default gw 172.16.1.254 eth3&#xD;
  177. route add -net 192.168.101.0/24 gw 192.168.101.2 dev eth1&#xD;
  178. route add -net 192.168.1.0/24 gw 192.168.101.2 dev eth1&#xD;
  179. route add -net 192.168.102.0/24 gw 192.168.102.2 dev eth2&#xD;
  180. route add -net 192.168.2.0/24 gw 192.168.102.2 dev eth2&#xD;
  181. &#xD;
  182. &#xD;
  183. iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE&#xD;
  184. iptables -A FORWARD -i eth2 -j ACCEPT&#xD;
  185. iptables -A FORWARD -i eth1 -j ACCEPT&#xD;
  186. /sbin/tc qdisc add dev eth3 root handle 1:1 netem delay 100ms&#xD;
  187. service ssh start&#xD;
  188. &#xD;
  189. exit 0&#xD;
  190. </entry>
  191. </extensions>
  192. <interface id="0" name="Ethernet1" ipv4="192.168.101.1" netPrefixLenV4="24"/>
  193. <interface id="1" name="Ethernet2" ipv4="192.168.102.1" netPrefixLenV4="24"/>
  194. <interface id="2" name="Ethernet3"/>
  195. </node>
  196. <node name="iosv-2" type="SIMPLE" subtype="IOSv" location="480,286" ipv4="192.168.102.2">
  197. <extensions>
  198. <entry key="AutoNetkit.mgmt_ip" type="string"></entry>
  199. <entry key="config" type="String">! IOS Config generated on 2015-09-06 21:22&#xD;
  200. ! by autonetkit_0.18.1&#xD;
  201. !&#xD;
  202. hostname iosv-2&#xD;
  203. boot-start-marker&#xD;
  204. boot-end-marker&#xD;
  205. !&#xD;
  206. vrf definition Mgmt-intf&#xD;
  207. !&#xD;
  208. address-family ipv4&#xD;
  209. exit-address-family&#xD;
  210. !&#xD;
  211. address-family ipv6&#xD;
  212. exit-address-family&#xD;
  213. !&#xD;
  214. !&#xD;
  215. !&#xD;
  216. no aaa new-model&#xD;
  217. !&#xD;
  218. !&#xD;
  219. ip cef&#xD;
  220. ipv6 unicast-routing&#xD;
  221. ipv6 cef&#xD;
  222. !&#xD;
  223. !&#xD;
  224. service timestamps debug datetime msec&#xD;
  225. service timestamps log datetime msec&#xD;
  226. no service password-encryption&#xD;
  227. no service config&#xD;
  228. enable password cisco&#xD;
  229. ip classless&#xD;
  230. ip subnet-zero&#xD;
  231. no ip domain lookup&#xD;
  232. line vty 0 4&#xD;
  233. transport input ssh telnet&#xD;
  234. exec-timeout 720 0&#xD;
  235. password cisco&#xD;
  236. login&#xD;
  237. line con 0&#xD;
  238. password cisco&#xD;
  239. !&#xD;
  240. no cdp run&#xD;
  241. !&#xD;
  242. !&#xD;
  243. interface Loopback0&#xD;
  244. description Loopback&#xD;
  245. ip address 192.168.0.3 255.255.255.255&#xD;
  246. !&#xD;
  247. interface GigabitEthernet0/0&#xD;
  248. description OOB Management&#xD;
  249. vrf forwarding Mgmt-intf&#xD;
  250. ! Configured on launch&#xD;
  251. no ip address&#xD;
  252. duplex full&#xD;
  253. speed auto&#xD;
  254. no shutdown&#xD;
  255. !&#xD;
  256. interface GigabitEthernet0/1&#xD;
  257. description to wanEM&#xD;
  258. ip address 192.168.102.2 255.255.255.0&#xD;
  259. ip ospf cost 1&#xD;
  260. duplex full&#xD;
  261. speed auto&#xD;
  262. no shutdown&#xD;
  263. !&#xD;
  264. interface GigabitEthernet0/2&#xD;
  265. description to server-2&#xD;
  266. ip address 192.168.2.1 255.255.255.0&#xD;
  267. ip ospf cost 1&#xD;
  268. duplex full&#xD;
  269. speed auto&#xD;
  270. no shutdown&#xD;
  271. !&#xD;
  272. !&#xD;
  273. !&#xD;
  274. ip route 0.0.0.0 0.0.0.0 192.168.102.1&#xD;
  275. !&#xD;
  276. end&#xD;
  277. </entry>
  278. <entry key="Auto-generate config" type="Boolean">false</entry>
  279. </extensions>
  280. <interface id="0" name="GigabitEthernet0/1" ipv4="192.168.102.2" netPrefixLenV4="24"/>
  281. <interface id="1" name="GigabitEthernet0/2" ipv4="192.168.2.1" netPrefixLenV4="24"/>
  282. </node>
  283. <node name="server-2" type="SIMPLE" subtype="server" location="500,463">
  284. <extensions>
  285. <entry key="Auto-generate config" type="Boolean">false</entry>
  286. <entry key="config" type="String">#cloud-config&#xD;
  287. bootcmd:&#xD;
  288. - ln -s -t /etc/rc.d /etc/rc.local&#xD;
  289. hostname: server-2&#xD;
  290. manage_etc_hosts: true&#xD;
  291. runcmd:&#xD;
  292. - start ttyS0&#xD;
  293. - systemctl start getty@ttyS0.service&#xD;
  294. - systemctl start rc-local&#xD;
  295. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config&#xD;
  296. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
  297. - service ssh restart&#xD;
  298. - service sshd restart&#xD;
  299. users:&#xD;
  300. - default&#xD;
  301. - gecos: User configured by VIRL Configuration Engine 0.18.9&#xD;
  302. lock-passwd: false&#xD;
  303. name: cisco&#xD;
  304. plain-text-passwd: cisco&#xD;
  305. shell: /bin/bash&#xD;
  306. ssh-authorized-keys:&#xD;
  307. - VIRL-USER-SSH-PUBLIC-KEY&#xD;
  308. sudo: ALL=(ALL) ALL&#xD;
  309. write_files:&#xD;
  310. - path: /etc/init/ttyS0.conf&#xD;
  311. owner: root:root&#xD;
  312. content: |&#xD;
  313. # ttyS0 - getty&#xD;
  314. # This service maintains a getty on ttyS0 from the point the system is&#xD;
  315. # started until it is shut down again.&#xD;
  316. start on stopped rc or RUNLEVEL=[12345]&#xD;
  317. stop on runlevel [!12345]&#xD;
  318. respawn&#xD;
  319. exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
  320. permissions: '0644'&#xD;
  321. - path: /etc/systemd/system/dhclient@.service&#xD;
  322. content: |&#xD;
  323. [Unit]&#xD;
  324. Description=Run dhclient on %i interface&#xD;
  325. After=network.target&#xD;
  326. [Service]&#xD;
  327. Type=oneshot&#xD;
  328. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
  329. RemainAfterExit=yes&#xD;
  330. owner: root:root&#xD;
  331. permissions: '0644'&#xD;
  332. - path: /etc/rc.local&#xD;
  333. owner: root:root&#xD;
  334. permissions: '0755'&#xD;
  335. content: |-&#xD;
  336. #!/bin/sh -e&#xD;
  337. ifconfig eth1 up 192.168.2.100 netmask 255.255.255.0&#xD;
  338. route add -net 192.168.0.2/31 gw 192.168.2.1 dev eth1&#xD;
  339. route add -net 192.168.1.0/24 gw 192.168.2.1 dev eth1&#xD;
  340. route add -net 192.168.101.0/24 gw 192.168.2.1 dev eth1&#xD;
  341. route add -net 192.168.102.0/24 gw 192.168.2.1 dev eth1&#xD;
  342. route add -net 192.168.2.0/24 gw 192.168.2.1 dev eth1&#xD;
  343. route del default&#xD;
  344. route add default gw 192.168.2.1&#xD;
  345. exit 0&#xD;
  346. &#xD;
  347. - path: /etc/resolv.conf&#xD;
  348. owner: root:root&#xD;
  349. permissions: '0644'&#xD;
  350. content: |&#xD;
  351. # ttyS0 - getty&#xD;
  352. # This service maintains a getty on ttyS0 from the point the system is&#xD;
  353. # started until it is shut down again.&#xD;
  354. nameserver 8.8.8.8</entry>
  355. </extensions>
  356. <interface id="0" name="eth1" ipv4="192.168.2.100" netPrefixLenV4="24"/>
  357. </node>
  358. <node name="flat-1" type="ASSET" subtype="FLAT" location="358,16">
  359. <interface id="0" name="link0"/>
  360. </node>
  361. <connection dst="/virl:topology/virl:node[2]/virl:interface[1]" src="/virl:topology/virl:node[1]/virl:interface[2]"/>
  362. <connection dst="/virl:topology/virl:node[3]/virl:interface[1]" src="/virl:topology/virl:node[1]/virl:interface[1]"/>
  363. <connection dst="/virl:topology/virl:node[4]/virl:interface[1]" src="/virl:topology/virl:node[3]/virl:interface[2]"/>
  364. <connection dst="/virl:topology/virl:node[5]/virl:interface[1]" src="/virl:topology/virl:node[4]/virl:interface[2]"/>
  365. <connection dst="/virl:topology/virl:node[3]/virl:interface[3]" src="/virl:topology/virl:node[6]/virl:interface[1]"/>
  366. </topology>