1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-connecting-secondary-network-ssh.adoc
2025-11-18 16:29:25 +01:00

55 lines
1.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/virtual_machines/virt-accessing-vm-ssh.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-connecting-secondary-network-ssh_{context}"]
= Connecting to a VM attached to a secondary network by using SSH
[role="_abstract"]
You can connect to a virtual machine (VM) attached to a secondary network by using SSH.
.Prerequisites
* You attached a VM to a secondary network with a DHCP server.
* You have an SSH client installed.
* You have installed the {oc-first}.
.Procedure
. Obtain the IP address of the VM by running the following command:
+
[source,terminal]
----
$ oc describe vm <vm_name> -n <namespace>
----
+
Example output:
+
----
# ...
Interfaces:
Interface Name: eth0
Ip Address: 10.244.0.37/24
Ip Addresses:
10.244.0.37/24
fe80::858:aff:fef4:25/64
Mac: 0a:58:0a:f4:00:25
Name: default
# ...
----
. Connect to the VM by running the following command:
+
[source,terminal]
----
$ ssh <user_name>@<ip_address> -i <ssh_key>
----
+
Example:
+
[source,terminal]
----
$ ssh cloud-user@10.244.0.37 -i ~/.ssh/id_rsa_cloud-user
----