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.

156 lines
5.5 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" simulationEngine="OPENSTACK" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
  3. <node name="lxc-iperf-1" type="SIMPLE" subtype="lxc-iperf" location="235,162">
  4. <extensions>
  5. <entry key="config" type="string"> </entry>
  6. </extensions>
  7. <interface id="0" name="eth1" ipv4="10.0.0.6" netPrefixLenV4="30"/>
  8. </node>
  9. <node name="lxc-iperf-2" type="SIMPLE" subtype="lxc-iperf" location="785,162">
  10. <extensions>
  11. <entry key="config" type="string"> </entry>
  12. </extensions>
  13. <interface id="0" name="eth1" ipv4="10.0.0.14" netPrefixLenV4="30"/>
  14. </node>
  15. <node name="VPN-Gateway1" type="SIMPLE" subtype="server" location="374,162">
  16. <extensions>
  17. <entry key="config" type="String">#cloud-config&#xD;
  18. bootcmd:&#xD;
  19. - ln -s -t /etc/rc.d /etc/rc.local&#xD;
  20. hostname: VPN-Gateway1&#xD;
  21. manage_etc_hosts: true&#xD;
  22. runcmd:&#xD;
  23. - start ttyS0&#xD;
  24. - systemctl start getty@ttyS0.service&#xD;
  25. - systemctl start rc-local&#xD;
  26. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config&#xD;
  27. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config&#xD;
  28. - service ssh restart&#xD;
  29. - service sshd restart&#xD;
  30. users:&#xD;
  31. - default&#xD;
  32. - gecos: User configured by VIRL Configuration Engine 0.18.10&#xD;
  33. lock-passwd: false&#xD;
  34. name: cisco&#xD;
  35. plain-text-passwd: cisco&#xD;
  36. shell: /bin/bash&#xD;
  37. ssh-authorized-keys:&#xD;
  38. - VIRL-USER-SSH-PUBLIC-KEY&#xD;
  39. sudo: ALL=(ALL) ALL&#xD;
  40. write_files:&#xD;
  41. - path: /etc/init/ttyS0.conf&#xD;
  42. owner: root:root&#xD;
  43. content: |&#xD;
  44. # ttyS0 - getty&#xD;
  45. # This service maintains a getty on ttyS0 from the point the system is&#xD;
  46. # started until it is shut down again.&#xD;
  47. start on stopped rc or RUNLEVEL=[12345]&#xD;
  48. stop on runlevel [!12345]&#xD;
  49. respawn&#xD;
  50. exec /sbin/getty -L 115200 ttyS0 vt102&#xD;
  51. permissions: '0644'&#xD;
  52. - path: /etc/systemd/system/dhclient@.service&#xD;
  53. content: |&#xD;
  54. [Unit]&#xD;
  55. Description=Run dhclient on %i interface&#xD;
  56. After=network.target&#xD;
  57. [Service]&#xD;
  58. Type=oneshot&#xD;
  59. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease&#xD;
  60. RemainAfterExit=yes&#xD;
  61. owner: root:root&#xD;
  62. permissions: '0644'&#xD;
  63. - path: /etc/rc.local&#xD;
  64. owner: root:root&#xD;
  65. permissions: '0755'&#xD;
  66. content: |-&#xD;
  67. #!/bin/sh -e&#xD;
  68. ifconfig eth1 down&#xD;
  69. ifconfig eth2 up 10.0.0.5 netmask 255.255.255.252&#xD;
  70. ifconfig eth3 up&#xD;
  71. dhclient -nw eth3&#xD;
  72. systemctl start dhclient@eth3.service&#xD;
  73. sleep 5&#xD;
  74. apt-get update&#xD;
  75. apt-get install openvpn&#xD;
  76. exit 0&#xD;
  77. </entry>
  78. </extensions>
  79. <interface id="0" name="eth1"/>
  80. <interface id="1" name="eth2" ipv4="10.0.0.5" netPrefixLenV4="30"/>
  81. <interface id="2" name="eth3"/>
  82. </node>
  83. <node name="VPN-Gateway2" type="SIMPLE" subtype="server" location="592,162">
  84. <extensions>
  85. <entry key="config" type="string">#cloud-config
  86. bootcmd:
  87. - ln -s -t /etc/rc.d /etc/rc.local
  88. hostname: VPN-Gateway2
  89. manage_etc_hosts: true
  90. runcmd:
  91. - start ttyS0
  92. - systemctl start getty@ttyS0.service
  93. - systemctl start rc-local
  94. - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
  95. - echo "UseDNS no" &gt;&gt; /etc/ssh/sshd_config
  96. - service ssh restart
  97. - service sshd restart
  98. users:
  99. - default
  100. - gecos: User configured by VIRL Configuration Engine 0.18.10
  101. lock-passwd: false
  102. name: cisco
  103. plain-text-passwd: cisco
  104. shell: /bin/bash
  105. ssh-authorized-keys:
  106. - VIRL-USER-SSH-PUBLIC-KEY
  107. sudo: ALL=(ALL) ALL
  108. write_files:
  109. - path: /etc/init/ttyS0.conf
  110. owner: root:root
  111. content: |
  112. # ttyS0 - getty
  113. # This service maintains a getty on ttyS0 from the point the system is
  114. # started until it is shut down again.
  115. start on stopped rc or RUNLEVEL=[12345]
  116. stop on runlevel [!12345]
  117. respawn
  118. exec /sbin/getty -L 115200 ttyS0 vt102
  119. permissions: '0644'
  120. - path: /etc/systemd/system/dhclient@.service
  121. content: |
  122. [Unit]
  123. Description=Run dhclient on %i interface
  124. After=network.target
  125. [Service]
  126. Type=oneshot
  127. ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
  128. RemainAfterExit=yes
  129. owner: root:root
  130. permissions: '0644'
  131. - path: /etc/rc.local
  132. owner: root:root
  133. permissions: '0755'
  134. content: |-
  135. #!/bin/sh -e
  136. ifconfig eth1 down
  137. ifconfig eth2 up 10.0.0.13 netmask 255.255.255.252
  138. ifconfig eth3 up
  139. dhclient -nw eth3
  140. systemctl start dhclient@eth3.service
  141. exit 0
  142. </entry>
  143. </extensions>
  144. <interface id="0" name="eth1"/>
  145. <interface id="1" name="eth2" ipv4="10.0.0.13" netPrefixLenV4="30"/>
  146. <interface id="2" name="eth3"/>
  147. </node>
  148. <node name="flat-1" type="ASSET" subtype="FLAT" location="498,126">
  149. <interface id="0" name="link0"/>
  150. <interface id="1" name="link1"/>
  151. </node>
  152. <connection dst="/virl:topology/virl:node[1]/virl:interface[1]" src="/virl:topology/virl:node[3]/virl:interface[2]"/>
  153. <connection dst="/virl:topology/virl:node[2]/virl:interface[1]" src="/virl:topology/virl:node[4]/virl:interface[2]"/>
  154. <connection dst="/virl:topology/virl:node[5]/virl:interface[1]" src="/virl:topology/virl:node[3]/virl:interface[3]"/>
  155. <connection dst="/virl:topology/virl:node[5]/virl:interface[2]" src="/virl:topology/virl:node[4]/virl:interface[3]"/>
  156. </topology>