User Tools

Site Tools


network_stuff:juniper:vqfx:step-by-step-vqfx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
network_stuff:juniper:vqfx:step-by-step-vqfx [2020/01/19 14:15] jotasandokunetwork_stuff:juniper:vqfx:step-by-step-vqfx [2023/11/02 14:38] (current) – external edit 127.0.0.1
Line 2: Line 2:
 Based on https://codingpackets.com/blog/juniper-vqfx-vagrant-libvirt-box-install Based on https://codingpackets.com/blog/juniper-vqfx-vagrant-libvirt-box-install
      
-    mkdir -p ~/vagrant/boxes/juniper/vqfx +  mkdir -p ~/vagrant/boxes/juniper/vqfx 
-    cd ~/vagrant/boxes/juniper/vqfx +  cd ~/vagrant/boxes/juniper/vqfx 
-   +  cp /data/images/vqfx10k-pfe-virtualbox.box /root/vagrant/boxes/juniper/vqfx/ 
-   +  cp /data/images/jinstall-vqfx-10-f-17.4R1.16.img /root/vagrant/boxes/juniper/vqfx/ 
-    cp /data/images/vqfx10k-pfe-virtualbox.box /root/vagrant/boxes/juniper/vqfx/ +  tar -xvf vqfx10k-pfe-virtualbox.box
-    cp /data/images/jinstall-vqfx-10-f-17.4R1.16.img /root/vagrant/boxes/juniper/vqfx/ +
-   +
-    tar -xvf vqfx10k-pfe-virtualbox.box +
-   +
-    qemu-img convert -f vmdk -O qcow2 packer-virtualbox-ovf-1520878605-disk001.vmdk pfe.qcow2 +
-     +
-    curl -O https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/master/tools/create_box.sh +
-    chmod 775 create_box.sh +
      
 +\\
 +
 +  qemu-img convert -f vmdk -O qcow2 packer-virtualbox-ovf-1520878605-disk001.vmdk pfe.qcow2
 +\\
 +
 +  curl -O https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/master/tools/create_box.sh
 +  chmod 775 create_box.sh 
   echo '{"provider":"libvirt","format":"qcow2","virtual_size":6}' > metadata.json   echo '{"provider":"libvirt","format":"qcow2","virtual_size":6}' > metadata.json
-   
   bash create_box.sh pfe.qcow2   bash create_box.sh pfe.qcow2
      
 +\\
   cat << EOF > pfe.json   cat << EOF > pfe.json
   {   {
Line 37: Line 36:
   }   }
   EOF   EOF
-   +    vagrant box add pfe.json 
-  vagrant box add pfe.json+ 
 +\\
      
   mv jinstall-vqfx-10-f-17.4R1.16.img vqfx-re.qcow2   mv jinstall-vqfx-10-f-17.4R1.16.img vqfx-re.qcow2
-   
-   
   virt-install \   virt-install \
       --name vqfx-re \       --name vqfx-re \
Line 49: Line 47:
       --vcpus=1 \       --vcpus=1 \
       --import \       --import \
-      --disk path=re.qcow2,size=4,bus=ide,format=qcow2 \+      --disk path=vqfx-re.qcow2,size=4,bus=ide,format=qcow2 \
       --network=network:vagrant-libvirt,model=e1000 \       --network=network:vagrant-libvirt,model=e1000 \
       --network=network:vagrant-libvirt,model=e1000 \       --network=network:vagrant-libvirt,model=e1000 \
       --graphics none       --graphics none
-   +\\ 
-  +  # In console 
 +  cli 
 +  edit
   set interfaces em0 unit 0 family inet dhcp   set interfaces em0 unit 0 family inet dhcp
   set system services ssh root-login allow   set system services ssh root-login allow
-  set system root-authentication plain-text-password+  set system root-authentication plain-text-password    # Juniper
   commit and-quit   commit and-quit
-   
   show interfaces terse | match em0.0       show interfaces terse | match em0.0    
   em0.0                   up    up   inet     192.168.121.74/24   em0.0                   up    up   inet     192.168.121.74/24
 +  exit
 +  Ctrl-Shift-]
      
-  +\\ 
   ssh root@192.168.121.74   ssh root@192.168.121.74
   cli   cli
   start shell user root   start shell user root
-   
   # root shell   # root shell
   cat << EOF > bootup.sh   cat << EOF > bootup.sh
Line 77: Line 78:
   /usr/sbin/cli -c 'configure;set interfaces em0.0 family inet dhcp;commit comment "Commit by script"'   /usr/sbin/cli -c 'configure;set interfaces em0.0 family inet dhcp;commit comment "Commit by script"'
   EOF   EOF
 +
 +\\
      
   chmod +x bootup.sh   chmod +x bootup.sh
-   
   crontab -e   crontab -e
   @reboot /bin/sh /var/root/bootup.sh   @reboot /bin/sh /var/root/bootup.sh
-  + 
 +\\  
   cli   cli
-   
   set system login user vagrant uid 2000   set system login user vagrant uid 2000
   set system login user vagrant class super-user   set system login user vagrant class super-user
Line 95: Line 97:
   set system services netconf ssh   set system services netconf ssh
   commit and-quit   commit and-quit
-   
   exit   exit
 +
 +\\
      
   ssh vagrant@192.168.121.74 -i ~/.vagrant.d/insecure_private_key   ssh vagrant@192.168.121.74 -i ~/.vagrant.d/insecure_private_key
   exit   exit
 +\\
      
   #Now from console   #Now from console
Line 105: Line 109:
   commit and-quit   commit and-quit
   request system power-off   request system power-off
-   +  virsh destroy vqfx-re 
-  +\\  
      
   echo '{"provider":"libvirt","format":"qcow2","virtual_size":4}' > metadata.json   echo '{"provider":"libvirt","format":"qcow2","virtual_size":4}' > metadata.json
Line 127: Line 131:
   }   }
   EOF   EOF
-   
-   
   vagrant box add re.json   vagrant box add re.json
-  +  vagrant box list 
 +\\   
   cd /home/jaime.santos.amandi/junos-vqfx-vagrant-virtual-lab   cd /home/jaime.santos.amandi/junos-vqfx-vagrant-virtual-lab
   vagrant up   vagrant up
network_stuff/juniper/vqfx/step-by-step-vqfx.1579443305.txt.gz · Last modified: (external edit)