SSH commands

Some good info: https://hackertarget.com/ssh-examples-tunnels

Move in a directory

root@eve-ng:~# cd ..
root@eve-ng:~# cd /opt/unetlab/addons/qemu

View all existing file

root@eve-ng:/opt/unetlab/addons/qemu# ls
root@eve-ng:/opt/unetlab/addons/qemu# ls nextExisting_File_Name

Create a new directory

root@eve-ng:/opt/unetlab/addons/qemu# mkdir newDirName

Rename Directory

root@eve-ng:/opt/unetlab/addons/qemu# mv oldDirName NewDirName

Rename Files:

root@eve-ng:/opt/unetlab/addons/qemu# mv oldFileName newFileName

Create qcow2 file

root@eve-ng:/opt/unetlab/addons/qemu/NeededFolder# /opt/qemu/bin/qemu-img create -f qcow2 hda.qcow2 30G (use what needed)

Delete files

root@eve-ng:/opt/unetlab/addons/qemu# sudo rm myFile.txt myFile1.txt myFile2.txt
Password: ...

Delete a whole folder and its content

root@eve-ng:/opt/unetlab/addons/qemu# sudo rm -rf foldername/
Password: ...

Problem and solution

Problem when using ssh

murgescusilvia@Murgescus-MacBook-Pro ~ % ssh silvia@ip-address  

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

The ECDSA host key for us01 has changed, and the key for the corresponding IP address ip-address is unchanged. 
This could either mean that DNS SPOOFING is happening or the IP address for the host and its host key have changed at the same time. 
Offending key for IP in /Users/murgescusilvia/.ssh/known_hosts:20 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. 

The fingerprint for the ECDSA key sent by the remote host is SHA256:5b11LsICh7VVaHkfY/HiLh6IThcZYjkkDD7Pt6dixJw. 

Please contact your system administrator. Add correct host key in /Users/murgescusilvia/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /Users/murgescusilvia/.ssh/known_hosts:19 ECDSA host key for ip-address has changed and you have requested strict checking. 

Host key verification failed.

Solution to solve this problem:

murgescusilvia@Murgescus-MacBook-Pro ~ % ssh-keygen -R ip-address 

# Host ip-address found: line 19 /Users/murgescusilvia/.ssh/known_hosts updated. 
Original contents retained as /Users/murgescusilvia/.ssh/known_hosts.old

I will add a command every time I search and use something.

2020.04.30 – CentOS installation into EVE-NG

All used information to install I found here:

Using things:

  • EVE-PRO meaning with license
  • CentOS CentOS-8.1.1911-x86_64-dvd1.iso

Step 1. Download CentOS – donloaded from Download CentOS version Linux DVD ISO

See 2. Go into EVE-PRO and move into qemu directory

root@eve-ng:~# cd /opt/unetlab/addons/qemu

Step 3. Create a new directory and move inside it

root@eve-ng:/opt/unetlab/addons/qemu# mkdir linux-centeros-8
root@eve-ng:/opt/unetlab/addons/qemu# cd linux-centeros-8
root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8#

Step 4. Upload CentOS-8.1.1911-x86_64-dvd1.iso in EVE-PRO using FilaFilla application

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# ls
CentOS-8.1.1911-x86_64-dvd1.iso

Step 6. Create qcow2 file

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# /opt/qemu/bin/qemu-img create -f qcow2 hda.qcow2 40G
Formatting 'hda.qcow2', fmt=qcow2 size=42949672960 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# 

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# ls
CentOS-8.1.1911-x86_64-dvd1.iso  hda.qcow2
root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# 

Step 6. Rename CentOS-8.1.1911-x86_64-dvd1.iso file

oot@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# mv CentOS-8.1.1911-x86_64-dvd1.iso cdrom.iso

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# ls
cdrom.iso  hda.qcow2

Step 7. Login to EVE-PRO then Add new lab end add CentOS node

CentOS need to have

  • Name: CentOS
  • CPU: 2
  • RAM (MB): 4096
  • Ethernets: 2
  • QEMU Version : 2.4
  • QEMU arch: tpl (x86_64)
  • QEMU Nic: e1000-

Click SAVE

Add a switch and configure it as Type: Management (Cloud0) and click Save

Connect

Step 8. Now ready to start CentOS

Do not click anything, just wait …

Step 9. Go throw installation process

English and Continue

Verify and configure different things…

Keuboard: English

Installation Destination: ATA QENU HARDDISK

After finishing click Begin Installation

During installation you need to insert toot password and user name and password

Root Pasword

User Name and Password. Also select Make this user admin

Wait to finish installation

Step 10. Restating CentOS

Before restarting CentOS you need to modify the name if application needed to install

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# mv cdrom.iso centos-install.iso

I do not like restart. I click restart, then power-off and them power-on or Start

Step 11. Go throw internal installation process.

Click License Information

I accept the license agreement.

Click Finish configuration

English and Next

English (US) and Next

Privacy OFF and Next

Connect Your Online: Skip

Finish to install internal

Step 12. Networks

Select Wired Settings

I don’t have Automatic Ethernet on these network, si I have to configure it manually

Open Terminal

Use ifconfig command

I will do not this now ….

Step 13. Save the configured CentOS for all new EVE-PRO lab

Into EVE-PRO open Lab Details

Use SSH

root@eve-ng:/opt/unetlab/tmp/0/085884f1-7807-492d-814f-7b588fd1892c/1# ls
cdrom.iso  hda.qcow2  l1down_1  l1up_0  mon-sock  mon2-sock  qmp-sock  wrapper.txt

root@eve-ng:/opt/unetlab/tmp/0/085884f1-7807-492d-814f-7b588fd1892c/1# /opt/qemu/bin/qemu-img commit hda.qcow2


Image committed.

Here is tha same

root@eve-ng:/opt/unetlab/tmp/0/085884f1-7807-492d-814f-7b588fd1892c/1# ls
cdrom.iso  hda.qcow2  l1down_1  l1up_0  mon-sock  mon2-sock  qmp-sock  wrapper.txt

A needed command to make it work as configured

root@eve-ng:/opt/unetlab/addons/qemu/linux-centeros-8# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions


May 01 07:09:28 May 01 07:09:28 Online Check state: Valid

All done. CentOS is ready to go. We will now add a couple of nodes to confirm that CentOS is working.

Step 14. Verify that CentOS is working

Add a total of three CentOS

Power-on all

All 3 can power-on …

Step 14. Configure and Mange Network Connection using nmcli

The needed information I find here: How to configure and Manage Network Connections using nmcli. I use The nmcli connection sub-command chapter.

  • View connection profiles
# nmcli connection show 
NAME UUID TYPE DEVICE 
virbr0 bbe539aa-7042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet virbr0
virbr0-nic bbe539aa-8042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet virbr0-nic
ens3 bbe539aa-5042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet --
ens4 bbe539aa-6042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet --
  • The nmcli connection add Command
$ nmcli connection add con-name new-ens3 ifname ens3 type ethernet ip4 192.168.1.25/24 gw4 192.168.2.1 
Connection 'new-ens3' (f0c23472-1aec-4e84-8f1b-be8a2ecbeade) successfully added.

$ nmcli connection add con-name new-ens4 ifname ens4 type ethernet ip4 172.25.11.254/24 gw4 172.25.11.254
Connection 'new-ens4' (f0c23472-1aec-5e84-8f1b-be8a2ecbeade) successfully added.
# nmcli connection show
NAME UUID TYPE DEVICE
new-ens3 bbe539aa-9042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet ens3
new-ens4 bbe539aa-1042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet ebs4
virbr0 bbe539aa-7042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet virbr0
virbr0-nic bbe539aa-8042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet virbr0-nic
ens3 bbe539aa-5042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet --
ens4 bbe539aa-6042-4d28-a0e6-2a4d4f5dd744 802-3-ethernet --
# ls /etc/sysconfig/network-scripts/ifcfg* 
/etc/sysconfig/network-scripts/ifcfg-ens3 /etc/sysconfig/network-scripts/ifcfg-new-ens3
/etc/sysconfig/network-scripts/ifcfg-ens4 /etc/sysconfig/network-scripts/ifcfg-new-ens4

I can see this but I modify using nmcli command

I hope all detail help me and you in future use.

2020.04.26 – Ubuntu Server Problem: Failed to obtain SCST version information. Are the SCST modules loaded?

This page is abut a problem into Ubuntu server 18.04. Same problem, same preparation that cause the problem and in different Ubuntu 18.04 and.

All happen when working to chapter of Building a VMware vSphere Virtual Lab with VMware Fusion – Part 5: Create a Ubuntu iSCSI Target and Configure Multipathing

Case 1. After Upgrading Ubuntu Server 16.04 to 18.04 LTS in 2020.04.11

Problem:

silvia@silvia:~$ sudo scstadmin -config /etc/scst.conf
Failed to obtain SCST version information. Are the SCST modules loaded?

I try restarting scst and running the config command again:

silvia@silvia:~$ sudo /etc/init.d/scst stop
[ ok ] Stopping scst (via systemctl): scst.service.
silvia@silvia:~$ sudo /etc/init.d/scst start
[ ok ] Starting scst (via systemctl): scst.service.
silvia@silvia:~$ sudo scstadmin -config /etc/scst.conf
Failed to obtain SCST version information. Are the SCST modules loaded?

What does dkms status show?

silvia@silvia:~$ dkms status
scst, 3.4.0, 4.15.0-96-generic, x86_64: installed

Case 2. After installing Linux (Ubuntu Server 18.04) on a Mac with VMware Fusion in 2020.04.13

At the and of chapter Building a VMware vSphere Virtual Lab with VMware Fusion – Part 5: Create a Ubuntu iSCSI Target and Configure Multipathing it is a problem. To solve the problem I apply again all from the chapter of Step 4.2. Installing SCST on Ubuntu 18.04.

The same problem appears at Step 4.6. Export the disk image as an iSCSI LUN:

silvia@silvia:~/scst-build/scst$ sudo scstadmin -config /etc/scst.conf
Failed to obtain SCST version information. Are the SCST modules loaded?

I don’t know a solution to solve this problem.

2020.04.26 – Juniper Junos Space Network Management installation into EVE-PRO

The information for installation is from here : https://www.eve-ng.net/index.php/documentation/howtos/juniper-j-space/

>>>>>>>> Chapter 1:

  • EVE Image Name: jspace-19.3R1.3
  • Downloaded Original Filename: space-19.3R1.3.qcow2
  • Version: 19.3R1.3
  • vCPUs: 2
  • vRAM: 8192
  • HDD Format: virtioa
  • Console: vnc/https
  • Interfaces: x2 virtio

Chapter 1 topic:

Step 1. Download KVM qcow2 image from Juniper.

Step 2. Using our image table, create correct image folder, this example is for image jspace- in the table above.

mkdir /opt/unetlab/addons/qemu/jspace-19.3R1.3/

Step 3. Upload the downloaded image to the EVE /opt/unetlab/addons/qemu/jspace-19.3R1.3 folder using for example FileZilla or WinSCP.

Step 4. From the EVE cli, go to newly created image folder.

cd /opt/unetlab/addons/qemu/jspace-19.3R1.3/

Step 5. Rename original filename to virtioa.qcow2

mv space-19.3R1.3.qcow2 virtioa.qcow2 

Step 6.  Fix permissions:

/opt/unetlab/wrappers/unl_wrapper -a fixpermissions


Step 7. Open a lab, add Junos Space and power-on

Step 8. Default logins:

CLI: admin/abc123
https: super/juniper123

>>>>>>>> Chapter 2:

  • EVE Image Name: jspace-20.1R1.2
  • Downloaded Original Filename: space-20.1R1.2.qcow2
  • Version: 20.1R1.2
  • vCPUs: 2
  • vRAM: 8192
  • HDD Format: virtioa
  • Console: vnc/https
  • Interfaces: x2 virtio

Chapter 2 topic:

Note: I have installed and it does’n work for me. Maybe it work for you … just try it!

Step 1. Download KVM qcow2 image from Juniper.

Step 2. Using our image table, create correct image folder, this example is for image jspace- in the table above.

mkdir /opt/unetlab/addons/qemu/jspace-20.1R1.2/

Step 3. Upload the downloaded image to the EVE /opt/unetlab/addons/qemu/jspace-20.1R1.2 folder using for example FileZilla or WinSCP.

Step 4. From the EVE cli, go to newly created image folder.

cd /opt/unetlab/addons/qemu/jspace-20.1R1.2/

Step 5. Rename original filename to virtioa.qcow2

mv space-20.1R1.2.qcow2 virtioa.qcow2 

Step 6.  Fix permissions:

/opt/unetlab/wrappers/unl_wrapper -a fixpermissions


Step 7. Open a lab, add Junos Space and power-on

Step 8. Default logins:

CLI: admin/abc123
https: super/juniper123

Getting Start Guid: https://www.juniper.net/documentation/en_US/junos-space20.1/platform/topics/concept/junos-space-getting-started-fabric-architecture-overview.html

2020.04.25 – Juniper vSRX-NG installation into EVE-PRO

I used this guid for my installation:: https://www.eve-ng.net/index.php/documentation/howtos/howto-add-juniper-vsrx-ng-15-x-and-later/

Versions this guide is based on:

  • Name: vsrxng-20.3R1.81
  • Download original filename: junos-vsrx3-x86-64-20.3R1.8.qcow2
  • Version: 20.3R1.8
  • VCPUS: 2
  • VRAM: 4096

Step 1. Create correct image folder

root@eve-ng:/opt/unetlab/addons/qemu# mkdir vsrxng-20.3R1.18

Step 2. Upload the downloaded image to the EVE /opt/unetlab/addons/qemu/vsrxng-23.3R1.18/  folder using for example FileZilla or WinSCP using:

  • Host: eve-pro-ip
  • Username: root
  • Password: *******
  • Port: 22

Click Quickconnect, open source from MacBook Pro and destination to EVE-PRO and download junos-vsrx3-x86-64-20.3R1.8.qcow2.

Step 3. From the EVE cli, go to newly created image folder.

root@eve-ng:/opt/unetlab/addons/qemu# cd vsrxng-20.3R1.18

root@eve-ng:/opt/unetlab/addons/qemu/vsrxng-20.3R1.18# ls
junos-vsrx3-x86-64-20.3R1.8.qcow2

Step 4. Rename original filename to virtioa.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vsrxng-20.3R1.18# mv junos-vsrx3-x86-64-20.3R1.8.qcow2 virtioa.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vsrxng-20.3R1.18# ls
virtioa.qcow2 

Step 5. Fix permissions:

root@eve-ng:/opt/unetlab/addons/qemu/vsrxng-20.3R1.18# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions


Dec 01 11:34:26 Dec 01 11:34:26 Online Check state: Valid


root@eve-ng:/opt/unetlab/addons/qemu/vsrxng-20.3R1.18# 

Step 6. Create a testing lab and open:

Step 7. By default the number of interfaces are 4: fxp0 and ge-0/0/0-ge-0/0/2 but you can inches the number. To increase the number of interfaces change the default Ethernets configuration of 4 to 10. The maximum is to ge-0/0/8.

Enjoy!!

2020.04.23 – Juniper vRR installation into EVE-PRO

Inspiration in EVE guid: https://www.eve-ng.net/index.php/documentation/howtos/howto-add-juniper-vrr/ where it is made with version 17.4R1.16.

  • Note: I have installed three times.
    • Firs time with vRR 19.2R1.8 (vrr-bundle-kvm-19.2R1.8.tar) – workilg OK!
    • second time with vRR 20.1R1.11 (vrr-bundle-kvm-20.1R1.11.tar) – not work!
    • third time with vRR 19.4R1.10 (vrr-bundle-kvm-19.4R1.10.tar) – working OK!

The blog is about third installation exactly as the first installation.

Read more

2020.04.22 – Juniper vQFX installation into EVE-PRO

Inspiration in EVE guid: https://www.eve-ng.net/index.php/documentation/howtos/howto-add-juniper-vqfx/

Note in 2021.05.14: I used vQFX in my labs and I had many problems. PING does not work! At the version 20.2 also does not work ping. Now I install and try to use vQFX 20.3. I will come back here to say my result!!

Note in 2021.05.16: I tried all vQFX versions that I find to download from Juniper. No one work for me. Support EVE-PRO helped me with a vQFX 18.4 and was OK to ping between 2 different vQFX switches.

vQFX 18.4 contains different applications .qcow2 or .qcow or .img to download from Juniper. I used 2 Application Media 18.4R2-S2 but maybe EVE-PRO helped me with application, one or both, from Application Package.

To find a version it works, you have to try many possibility!!

Original article

Step 1

Use your Juniper access for login and download images.

Read more

2020.04.18 – Install EVE-NG: THE Network Emulator!

What I found and I use as help to download and install EVE-NG is from here: https://thenetworkberg.com/eve-ng-first-time-configuration/

Note: This article is for EVE-PRO in MacBook Pro in VMware!!

Need to have something similar:

  • MacBook Pro (15-inch, 2016):
    • macOS Catalina version 10.15.3
    • Processor 2,9 GHs Quad-Core Intel
    • Memory 16 GB 2133 MHsLPDDR3 (of RAM)
  • VMware Fusion 11.5.3 installed

EVE-NG Community Cookbook: https://www.eve-ng.net/index.php/documentation/community-cookbook/

Example photos are here: https://photos.app.goo.gl/gXuJeuVpzjZ2CLnw9

Read more