Description

This article provides examples of the commands required to access Hypervisor, virtual machines, and containers inside an NFX250 device.

For basic descriptions of the commands, refer to Accessing the JDM Shell, JDM CLI, and JCP Prompts in a Disaggregated Junos OS Platform .

 

Solution

By default, the first interface of all virtual machines and containers will be connected to the virbr0 Linux bridge on the Hypervisor. The virbr0 Linux bridge facilitates internal communication between the NFX components, for example, the virtual machines and the container.

 

Example Tasks

  • Use the following command to list the vnet interfaces on the virtual machine/container that is connected to the virbr0 Linux bridge:      

NFX-JDM :~# jhost brctl show
bridge name     bridge id               STP enabled     interfaces
ctrlbr0         8000.deba79b37502       no              iri1
                                                        vnet4
docker0         8000.56847afe9799       no
eth0br          8000.9afe95676798       no              eth0
                                                        vnet0
                                                        vnet3
                                                        vnet6
                                                        vnet8
eth1br          8000.000000000000       no
virbr0           8000.ec13dbdaf643       yes             ipsecnm-heth0
                                                        virbr0-nic
                                                        vnet1 >>>>>>>vjunos0
                                                        vnet2
                                                        vnet5 >>>>>>>vSRX-7
                                                        vnet7
 
  • Use the following command to list the Linux bridge, interface, and MAC addresses that are aligned to a specific virtual machine:

NFX-JDM:~# virsh domiflist vjunos0
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet1      bridge     virbr0     virtio      52:54:00:09:d6:f9
iri1       bridge     ctrlbr0    virtio      00:00:00:00:00:80
vnet3      bridge     eth0br     virtio      52:54:00:5c:0f:f7
vjunos0_em1 bridge     ovs-sys-br virtio      52:54:00:0e:ac:1a


NFX-JDM:~# virsh domiflist vSRX-7
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet5      network    default    virtio      ec:13:db:da:f6:4e
vnet6      bridge     eth0br     virtio      ec:13:db:da:f6:4f
-          vhostuser  -          virtio      ec:13:db:da:f6:50
-          vhostuser  -          virtio      ec:13:db:da:f6:51
-          vhostuser  -          virtio      ec:13:db:da:f6:52
-          hostdev    -          -           ec:13:db:da:f6:53
-          hostdev    -          -           ec:13:db:da:f6:54
 
  • You can also connect to various components inside the NFX device via an IP address instead of a hostname. To view the IP addresses of the various components, check the /etc/hosts file from the Junos Device Manager (JDM) shell:

NFX-JDM:~# cat /etc/hosts
127.0.0.1       localhost redis-server
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
192.168.1.1     hypervisor
192.168.1.2     vjunos0
192.168.1.3     vjunos1
192.168.1.4     vsrx
192.168.1.254   jdm NFX-JDM
128.0.0.254     jdm NFX-JDM
192.168.1.5     ipsec-nm
192.168.1.100    vSRX-7
192.168.1.101    vSRX-77

 
 
  • Access Hypervisor from the Junos Device Manager (JDM) CLI/shell:

      ssh hypervisor

  • Access Hypervisor from the Junos Control Plane (JCP) CLI/shell:

      rsh -JU __juniper_private4__ 192.168.1.1

  • Access Hypervisor from the JCP Operational prompt:

      request app-engine host-shell

  • Access the virtual machines console, including JCP/vJunos0, from the JDM shell after listing the virtual machine:
     
    root@NFX-JDM> start shell
    NFX-JDM:~# jhost virsh list
     
    Id    Name                           State
    ----------------------------------------------------
     2     vjunos0                        running
     3     vSRX-7                         running
     4     vSRX-77                        running

    NFX-JDM:~# jhost virsh console vjunos0
    Connected to domain vjunos0
    Escape character is ^]

    FreeBSD/i386 (Amnesiac) (ttyu0)

    login: root
    Password:
    Last login: Mon Oct 16 13:49:02 from 192.168.1.254

  • Access JCP from the JDM CLI/shell with the root password:

    ssh root@vjunos0

  • Access ipsec-nm from the JDM CLI/shell:

    ssh ipsec-nm

  • Access the ipsec-nm console from the JDM shell:

    NFX-JDM:~# jhost docker exec -it ipsec-nm  bash                          
    bash-4.3# cli
    root@ipsec-nm>  edit
    Entering configuration mode

    [edit]
    root@ipsec-nm#

 

Modification History

2018-08-03: Modified article to indicate that the commands apply only to NFX250 platform

 

Related Information