1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/cnv-configuring-masquerade-mode-cli.adoc
2019-07-10 10:39:32 +00:00

47 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * cnv/cnv_users_guide/cnv-using-the-default-pod-network-with-cnv.adoc
[id="cnv-configuring-masquerade-mode-cli_{context}"]
= Configuring masquerade mode from the command line
You can use masquerade mode to hide a virtual machine's outgoing traffic behind
the Pod IP address. Masquerade mode uses Network Address Translation (NAT) to
connect virtual machines to the Pod network backend through a Linux bridge.
Enable masquerade mode and allow traffic to enter the virtual machine by
editing your virtual machine configuration file.
.Prerequisites
* The virtual machine must be configured to use DHCP to acquire IPv4 addresses.
The examples below are configured to use DHCP.
.Procedure
. Edit the `interfaces` spec of your virtual machine configuration file:
+
[source,yaml]
----
kind: VirtualMachine
spec:
domain:
devices:
interfaces:
- name: red
masquerade: {} <1>
ports:
- port: 80 <2>
networks:
- name: red
pod: {}
----
<1> Connect using masquerade mode
<2> Allow incoming traffic on port 80
. Create the virtual machine:
+
----
$ oc create -f <vm-name>.yaml
----