// Module included in the following assemblies:
//
// * installing/installing-with-agent-based-installer/preparing-to-install-with-agent-based-installer.adoc

:_mod-docs-content-type: CONCEPT
[id="agent-install-networking_{context}"]
= About networking

[role="_abstract"]
The *rendezvous IP* must be known at the time of generating the agent ISO, so that during the initial boot all the hosts can check in to the assisted service.

If the IP addresses are assigned using a Dynamic Host Configuration Protocol (DHCP) server, then the `rendezvousIP` field must be set to an IP address of one of the hosts that will become part of the deployed control plane.
In an environment without a DHCP server, you can define IP addresses statically.

In addition to static IP addresses, you can apply any network configuration that is in NMState format. This includes VLANs and NIC bonds.

[NOTE]
====
By default, Podman uses a subnet of `10.88.0.0/16` as a bridge network.
Do not set the `network.machineNetwork.cidr` parameter to include this address range, otherwise a conflict causes the cluster installation to fail.
====

[id="agent-install-networking-ports_{context}"]
== Port requirements for the rendezvous host

During the discovery and bootstrap phases of an installation, all the hosts connect to the Assisted Service that runs on the rendezvous host. Configure your firewall to allow the following traffic from each host to the rendezvous host:

.Ports required to reach the Assisted Service on the rendezvous host
[cols="2a,2a,5a",options="header"]
|===
|Port
|Protocol
|Description

|`8090`
|TCP
|Assisted Service API. Hosts use this port to register with the Assisted Service, report hardware information, and retrieve installation instructions.
|===

[NOTE]
====
Port `8090` is required only during installation. After installation completes, the Assisted Service is no longer exposed on the rendezvous host.
====

This specific port requirement is in addition to the standard {product-title} networking requirements for installation.

[id="agent-install-networking-DHCP_{context}"]
== DHCP

When using Dynamic Host Configuration Protocol (DHCP), you must specify the value for the `rendezvousIP` field in the `agent-config.yaml` file, and the `networkConfig` fields can be left blank:

.Sample agent-config.yaml.file

[source,yaml]
----
apiVersion: v1alpha1
kind: AgentConfig
metadata:
  name: sno-cluster
rendezvousIP: 192.168.111.80
----
where:

`rendezvousIP`:: Specifies the IP address for the rendezvous host.

[id="agent-install-networking-static_{context}"]
== Static networking

When using static networking with the preferred `install-config.yaml` and `agent-config.yaml` files, you can specify the value for the `rendezvousIP` field in the `agent-config.yaml` file or allow the installation program to choose a static IP address from the `networkConfig` fields.


.Sample agent-config.yaml.file
[source,yaml]
----
cat > agent-config.yaml << EOF
apiVersion: v1alpha1
kind: AgentConfig
metadata:
  name: sno-cluster
rendezvousIP: 192.168.111.80
hosts:
  - hostname: master-0
    interfaces:
      - name: eno1
        macAddress: 00:ef:44:21:e6:a5
    networkConfig:
      interfaces:
        - name: eno1
          type: ethernet
          state: up
          mac-address: 00:ef:44:21:e6:a5
          ipv4:
            enabled: true
            address:
              - ip: 192.168.111.80
                prefix-length: 23
            dhcp: false
      dns-resolver:
        config:
          server:
            - 192.168.111.1
      routes:
        config:
          - destination: 0.0.0.0/0
            next-hop-address: 192.168.111.1
            next-hop-interface: eno1
            table-id: 254
EOF
----
where:

`rendezvousIP`:: Specifies the IP address for the rendezvous host. If a value is not specified for the `rendezvousIP` field, one address will be chosen from the static IP addresses specified in the `networkConfig` fields.
`hosts.interfaces.macAddress`:: Specifies the MAC address of an interface on the host, used to determine which host to apply the configuration to.
`ipv4.address.ip`:: Specifies the static IP address of the target bare-metal host.
`ipv4.address.prefix-length`:: Specifies the static IP address's subnet prefix for the target bare-metal host.
`dns-resolver.config.server`:: Specifies the DNS server for the target bare-metal host.
`routes.config.next-hop-address`:: Specifies the next-hop address for the node traffic. This must be in the same subnet as the IP address set for the specified interface.

When using static networking with the optional method of {ztp} custom resources, which comprises 6 custom resources, you can configure static IPs in the `nmstateconfig.yaml` file. The rendezvous IP is chosen from the static IP addresses specified in the `config` fields.

.Sample nmstateconfig.yaml file
[source,yaml]
----
apiVersion: agent-install.openshift.io/v1beta1
kind: NMStateConfig
metadata:
  name: master-0
  namespace: openshift-machine-api
  labels:
    cluster0-nmstate-label-name: cluster0-nmstate-label-value
spec:
  config:
    interfaces:
      - name: eth0
        type: ethernet
        state: up
        mac-address: 52:54:01:aa:aa:a1
        ipv4:
          enabled: true
          address:
            - ip: 192.168.122.2
              prefix-length: 23
          dhcp: false
    dns-resolver:
      config:
        server:
          - 192.168.122.1
    routes:
      config:
        - destination: 0.0.0.0/0
          next-hop-address: 192.168.122.1
          next-hop-interface: eth0
          table-id: 254
  interfaces:
    - name: eth0
      macAddress: 52:54:01:aa:aa:a1
----
where:

`ipv4.address.ip`:: Specifies the static IP address of the target bare-metal host.
`ipv4.address.prefix-length`:: Specifies the static IP address's subnet prefix for the target bare-metal host.
`dns-resolver.config.server`:: Specifies the DNS server for the target bare-metal host.
`routes.config.next-hop-address`:: Specifies the next-hop address for the node traffic. This must be in the same subnet as the IP address set for the specified interface.
`spec.interfaces.macAddress`:: Specifies the MAC address of an interface on the host, used to determine which host to apply the configuration to.
