Milestone 4 PowerCLI and Linked Clones - InaFricke/SEC-480 GitHub Wiki

Milestone 4 PowerCLI and Linked Clones

PowerShell & PowerCLI Installation

Ansible Dependencies

sudo apt install sshpass python3-paramiko git
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
ansible --version
cat >> ~/.ansible.cfg << EOF                                                               
[defaults]
host_key_checking = false
EOF
PowerCLI Dependencies

logout an in if you've just installed snapd, so that is added to path for current user.

Powershell Snap

sudo snap install powershell --classic
pwsh

Write-Host $PSVersionTable
PowerCLI Libraries
Install-Module VMware.PowerCLI -Scope CurrentUser
Get-Module VMware.PowerCLI -ListAvailable
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false
Connect with vcenter
Extracting base snapshots

The linked clone is now created.

Create base vm from the linked clone (independent versions)

Remove linked clone

Script Creation

  1. New-Item cloner.ps1

  2. Invoke-Item cloner.ps1

Vyos Base

Xubuntu Base

Org

  1. Create PROD and BASEVM folders

Xubuntu Base

  1. upload to the ISO folder
  1. Create a new VM in the Base folder > defaults until 6 >
  1. Power it on
  1. Create user, RoxiRules32
  1. Install openssh
  1. Remove ISO and reboot

  2. Login and run

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

  1. DNS

sudo netplan apply

  1. sudo shutdown -h now

  2. I accidentally removed the CD drive completely. Then, take a snapshot named baseline

VYOS Base

  1. power on

  2. log in, vyos, RoxiBoxi


configure
set service ssh listen-address 0.0.0.0
set interfaces ethernet eth0 address dhcp
delete interfaces ethernet eth0 hw-id
delete interfaces ethernet eth1 hw-id
commit
save
exit
shutdown -h now

  1. Remove anything in CD (I did this a while ago), take baseline snapshot (also already has it, so I'm a little confused)

Linked Clones

  1. Made script
  1. ubuntu.linked
  1. gui.linked
  1. vyos.linked

DHCP linked clone proof