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.

207 lines
5.7 KiB

10 years ago
  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="server-1" type="SIMPLE" subtype="server" location="221,242">
  4. <extensions>
  5. <entry key="config" type="string">#cloud-config
  6. bootcmd:
  7. - ln -s -t /etc/rc.d /etc/rc.local
  8. hostname: server-1
  9. manage_etc_hosts: true
  10. runcmd:
  11. - start ttyS0
  12. - systemctl start getty@ttyS0.service
  13. - systemctl start rc-local
  14. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
  15. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
  16. - service ssh restart
  17. - service sshd restart
  18. users:
  19. - default
  20. - gecos: User configured by VIRL Configuration Engine 0.15.5
  21. lock-passwd: false
  22. name: cisco
  23. plain-text-passwd: cisco
  24. shell: /bin/bash
  25. ssh-authorized-keys:
  26. - VIRL-USER-SSH-PUBLIC-KEY
  27. sudo: ALL=(ALL) ALL
  28. write_files:
  29. - path: /etc/init/ttyS0.conf
  30. owner: root:root
  31. content: |
  32. # ttyS0 - getty
  33. # This service maintains a getty on ttyS0 from the point the system is
  34. # started until it is shut down again.
  35. start on stopped rc or RUNLEVEL=[12345]
  36. stop on runlevel [!12345]
  37. respawn
  38. exec /sbin/getty -L 115200 ttyS0 vt102
  39. permissions: '0644'
  40. - path: /etc/systemd/system/dhclient@.service
  41. content: |
  42. [Unit]
  43. Description=Run dhclient on %i interface
  44. After=network.target
  45. [Service]
  46. Type=oneshot
  47. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
  48. RemainAfterExit=yes
  49. owner: root:root
  50. permissions: '0644'
  51. - path: /etc/rc.local
  52. owner: root:root
  53. permissions: '0755'
  54. content: |-
  55. #!/bin/sh -e
  56. ifconfig eth1 up 10.0.0.6 netmask 255.255.255.252
  57. route add -net 10.0.0.0/8 gw 10.0.0.5 dev eth1
  58. route add -net 192.168.0.0/29 gw 10.0.0.5 dev eth1
  59. exit 0
  60. </entry>
  61. </extensions>
  62. <interface id="0" name="eth1" ipv4="10.0.0.6" netPrefixLenV4="30"/>
  63. </node>
  64. <node name="iosv-1" type="SIMPLE" subtype="IOSv" location="448,100" ipv4="192.168.0.1">
  65. <extensions>
  66. <entry key="config" type="string">! IOS Config generated on 2015-06-15 11:16
  67. ! by autonetkit_0.15.1
  68. !
  69. hostname iosv-1
  70. boot-start-marker
  71. boot-end-marker
  72. !
  73. no aaa new-model
  74. !
  75. !
  76. ip cef
  77. ipv6 unicast-routing
  78. ipv6 cef
  79. !
  80. !
  81. service timestamps debug datetime msec
  82. service timestamps log datetime msec
  83. no service password-encryption
  84. no service config
  85. enable password cisco
  86. ip classless
  87. ip subnet-zero
  88. no ip domain lookup
  89. line vty 0 4
  90. transport input ssh telnet
  91. exec-timeout 720 0
  92. password cisco
  93. login
  94. line con 0
  95. password cisco
  96. !
  97. no cdp run
  98. !
  99. !
  100. interface Loopback0
  101. description Loopback
  102. ip address 192.168.0.1 255.255.255.255
  103. !
  104. interface GigabitEthernet0/0
  105. description OOB Management
  106. ! Configured on launch
  107. no ip address
  108. duplex auto
  109. speed auto
  110. no shutdown
  111. !
  112. interface GigabitEthernet0/1
  113. description to server-1
  114. ip address 10.0.0.5 255.255.255.252
  115. ip ospf cost 1
  116. duplex auto
  117. speed auto
  118. no shutdown
  119. !
  120. interface GigabitEthernet0/2
  121. description to server-2
  122. ip address 10.0.0.9 255.255.255.252
  123. ip ospf cost 1
  124. duplex auto
  125. speed auto
  126. no shutdown
  127. !
  128. !
  129. !
  130. router ospf 1
  131. network 192.168.0.1 0.0.0.0 area 0
  132. log-adjacency-changes
  133. passive-interface Loopback0
  134. network 10.0.0.4 0.0.0.3 area 0
  135. network 10.0.0.8 0.0.0.3 area 0
  136. !
  137. !
  138. </entry>
  139. <entry key="AutoNetkit.mgmt_ip" type="string"></entry>
  140. </extensions>
  141. <interface id="0" name="GigabitEthernet0/1" ipv4="10.0.0.5" netPrefixLenV4="30"/>
  142. <interface id="1" name="GigabitEthernet0/2" ipv4="10.0.0.9" netPrefixLenV4="30"/>
  143. </node>
  144. <node name="server-2" type="SIMPLE" subtype="server" location="569,239">
  145. <extensions>
  146. <entry key="config" type="string">#cloud-config
  147. bootcmd:
  148. - ln -s -t /etc/rc.d /etc/rc.local
  149. hostname: server-2
  150. manage_etc_hosts: true
  151. runcmd:
  152. - start ttyS0
  153. - systemctl start getty@ttyS0.service
  154. - systemctl start rc-local
  155. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
  156. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
  157. - service ssh restart
  158. - service sshd restart
  159. users:
  160. - default
  161. - gecos: User configured by VIRL Configuration Engine 0.15.5
  162. lock-passwd: false
  163. name: cisco
  164. plain-text-passwd: cisco
  165. shell: /bin/bash
  166. ssh-authorized-keys:
  167. - VIRL-USER-SSH-PUBLIC-KEY
  168. sudo: ALL=(ALL) ALL
  169. write_files:
  170. - path: /etc/init/ttyS0.conf
  171. owner: root:root
  172. content: |
  173. # ttyS0 - getty
  174. # This service maintains a getty on ttyS0 from the point the system is
  175. # started until it is shut down again.
  176. start on stopped rc or RUNLEVEL=[12345]
  177. stop on runlevel [!12345]
  178. respawn
  179. exec /sbin/getty -L 115200 ttyS0 vt102
  180. permissions: '0644'
  181. - path: /etc/systemd/system/dhclient@.service
  182. content: |
  183. [Unit]
  184. Description=Run dhclient on %i interface
  185. After=network.target
  186. [Service]
  187. Type=oneshot
  188. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
  189. RemainAfterExit=yes
  190. owner: root:root
  191. permissions: '0644'
  192. - path: /etc/rc.local
  193. owner: root:root
  194. permissions: '0755'
  195. content: |-
  196. #!/bin/sh -e
  197. ifconfig eth1 up 10.0.0.10 netmask 255.255.255.252
  198. route add -net 10.0.0.0/8 gw 10.0.0.9 dev eth1
  199. route add -net 192.168.0.0/29 gw 10.0.0.9 dev eth1
  200. exit 0
  201. </entry>
  202. </extensions>
  203. <interface id="0" name="eth1" ipv4="10.0.0.10" netPrefixLenV4="30"/>
  204. </node>
  205. <connection dst="/virl:topology/virl:node[2]/virl:interface[1]" src="/virl:topology/virl:node[1]/virl:interface[1]"/>
  206. <connection dst="/virl:topology/virl:node[3]/virl:interface[1]" src="/virl:topology/virl:node[2]/virl:interface[2]"/>
  207. </topology>