= Connecting to a remote {prod} instance

Use [application]`dnsmasq` to connect a client machine to a remote server running an {ocp} cluster managed by {prod}.

This procedure assumes the use of a {rhel}, {fed}, or {centos} client.
Run every command in this procedure on the client.

[IMPORTANT]
====
**Connect to a server that is only exposed on your local network.**
====

.Prerequisites
* A remote server is set up for the client to connect to.
For more information, see link:{crc-gsg-url}#setting-up-remote-server_gsg[Setting up {prod} on a remote server].
* You know the external IP address of the server.
* You have the link:{oc-download-url}[latest {openshift} CLI ([command]`oc`)] in your `$PATH` on the client.

.Procedure
. Install the [package]`dnsmasq` package:
+
----
$ sudo dnf install dnsmasq
----

. Enable the use of [application]`dnsmasq` for DNS resolution in NetworkManager:
+
----
$ sudo tee /etc/NetworkManager/conf.d/use-dnsmasq.conf &>/dev/null <<EOF
[main]
dns=dnsmasq
EOF
----

. Add DNS entries for {prod} to the [application]`dnsmasq` configuration:
+
[subs="+quotes"]
----
$ sudo tee /etc/NetworkManager/dnsmasq.d/external-crc.conf &>/dev/null <<EOF
address=/apps-crc.testing/__SERVER_IP_ADDRESS__
address=/api.crc.testing/__SERVER_IP_ADDRESS__
EOF
----
+
[NOTE]
====
Comment out any existing entries in [filename]*_/etc/NetworkManager/dnsmasq.d/crc.conf_*.
These entries are created by running a local instance of {prod} and will conflict with the entries for the remote cluster.
====

. Reload the NetworkManager service:
+
----
$ sudo systemctl reload NetworkManager
----

. Log in to the remote cluster as the `developer` user with [command]`oc`:
+
----
$ oc login -u developer -p developer https://api.crc.testing:6443
----
+
The remote {ocp} web console is available at \https://console-openshift-console.apps-crc.testing.
