diff --git a/modules/ipi-install-configuring-networking.adoc b/modules/ipi-install-configuring-networking.adoc index 9fea3ddea58b..1856edbc508c 100644 --- a/modules/ipi-install-configuring-networking.adoc +++ b/modules/ipi-install-configuring-networking.adoc @@ -6,109 +6,186 @@ [id="configuring-networking_{context}"] = Configuring networking -Before installation, you must configure the networking on the provisioner node. Installer-provisioned clusters deploy with a bare-metal bridge and network, and an optional provisioning bridge and network. +Before installation, you must configure networking settings for the provisioner node. Installer-provisioned clusters deploy with a bare-metal bridge and network resources, and an optional provisioning bridge and network resources. image::210_OpenShift_Baremetal_IPI_Deployment_updates_0122_1.png[Configure networking] [NOTE] ==== -You can also configure networking from the web console. +You can also configure networking settings from the {product-title} web console. ==== -.Procedure +.Prerequisites -. Export the bare-metal network NIC name by running the following command: -+ -[source,terminal] ----- -$ export PUB_CONN= ----- +* You installed the `nmstate` package with the `sudo dnf install -y ` command. The package includes the `nmstatectl` CLI. + +.Procedure . Configure the bare-metal network: + [NOTE] ==== -The SSH connection might disconnect after executing these steps. +When configuring the bare-metal network and the secure shell (SSH) connection disconnects, NMState has a rollback mechanism that automatically reverts any configurations. You can also use the `nmstatectl gc` tool to generate configuration files for specified network state files. ==== - -.. For a network using DHCP, run the following command: + -[source,terminal] +.. For a network using DHCP, run the following command to delete the `/etc/sysconfig/network-scripts/ifcfg-eth0` legacy style: ++ +[source,yaml,subs="+quotes"] +---- +$ nmcli con delete "System " ---- -$ sudo nohup bash -c " - nmcli con down \"$PUB_CONN\" - nmcli con delete \"$PUB_CONN\" - # RHEL 8.1 appends the word \"System\" in front of the connection, delete in case it exists - nmcli con down \"System $PUB_CONN\" - nmcli con delete \"System $PUB_CONN\" - nmcli connection add ifname baremetal type bridge baremetal bridge.stp no <1> - nmcli con add type bridge-slave ifname \"$PUB_CONN\" master baremetal - pkill dhclient;dhclient baremetal -" ----- -<1> Replace `` with the connection name. - -.. For a network using static IP addressing and no DHCP network, run the following command: + -[source,terminal] +where: ++ +``:: Replace `` with the name of your network interface controller (NIC). ++ +.. For a network that uses Dynamic Host Configuration Protocol (DHCP), create an NMState YAML file and specify the bare-metal bridge interface and any physical interfaces in the file: ++ +.Example bare-metal bridge interface configuration that uses DHCP +[source,yaml] +---- +# ... +interfaces: + - name: + type: ethernet + state: up + ipv4: + enabled: false + ipv6: + enabled: false + - name: baremetal + type: linux-bridge + state: up + ipv4: + enabled: true + dhcp: true + bridge: + options: + stp: + enabled: false + port: + - name: +# ... +---- ++ +.. For a network using static IP addressing and no DHCP network, create an NMState YAML file and specify the bare-metal bridge interface details in the file: ++ +.Example bare-metal bridge interface configuration that uses static IP addressing and no DHCP network +[source,yaml] +---- +# ... +dns-resolver: + config: + server: + - +routes: + config: + - destination: 0.0.0.0/0 + next-hop-interface: baremetal + next-hop-address: +interfaces: + - name: + type: ethernet + state: up + ipv4: + enabled: false + ipv6: + enabled: false + - name: baremetal + type: linux-bridge + state: up + ipv4: + enabled: true + dhcp: false + address: + - ip: + prefix-length: 24 + bridge: + options: + stp: + enabled: false + port: + - name: +# ... ---- -$ sudo nohup bash -c " - nmcli con down \"$PUB_CONN\" - nmcli con delete \"$PUB_CONN\" - # RHEL 8.1 appends the word \"System\" in front of the connection, delete in case it exists - nmcli con down \"System $PUB_CONN\" - nmcli con delete \"System $PUB_CONN\" - nmcli connection add ifname baremetal type bridge con-name baremetal bridge.stp no ipv4.method manual ipv4.addr "x.x.x.x/yy" ipv4.gateway "a.a.a.a" ipv4.dns "b.b.b.b" <1> - nmcli con add type bridge-slave ifname \"$PUB_CONN\" master baremetal - nmcli con up baremetal -" ----- -<1> Replace `` with the connection name. Replace `x.x.x.x/yy` with the IP address and CIDR for the network. Replace `a.a.a.a` with the network gateway. Replace `b.b.b.b` with the IP address of the DNS server. ++ +where: ++ +``:: Defines the DNS server for your bare-metal system. +``:: Replace `` with the IP address for the DNS server. +``:: Defines the bridge interface and its static IP configuration. +``:: Replace `` with the IP address of the gateway. +``:: Details the physical interface that you set as the bridge port. -. Optional: If you are deploying with a provisioning network, export the provisioning network NIC name by running the following command: +. Apply the network configuration from the YAML file to the network interfaces for the host by entering the following command: + [source,terminal] ---- -$ export PROV_CONN= +$ nmstatectl apply ---- -. Optional: If you are deploying with a provisioning network, configure the provisioning network by running the following command: +. Back up the network configuration YAML file by entering the following command: + [source,terminal] ---- -$ sudo nohup bash -c " - nmcli con down \"$PROV_CONN\" - nmcli con delete \"$PROV_CONN\" - nmcli connection add ifname provisioning type bridge con-name provisioning - nmcli con add type bridge-slave ifname \"$PROV_CONN\" master provisioning - nmcli connection modify provisioning ipv6.addresses fd00:1101::1/64 ipv6.method manual - nmcli con down provisioning - nmcli con up provisioning -" +$ nmstatectl show > backup-nmstate.yml ---- + +. Optional: If you are deploying your cluster in a provisioning network, create or edit an NMState YAML file and specify the details in the file. + [NOTE] ==== -The SSH connection might disconnect after executing these steps. - -The IPv6 address can be any address that is not routable through the bare-metal network. +The IPv6 address can be any address that does not route through the bare-metal network. -Ensure that UEFI is enabled and UEFI PXE settings are set to the IPv6 protocol when using IPv6 addressing. +Ensure that you enabled Unified Extensible Firmware Interface (UEFI) and set UEFI PXE settings for the IPv6 protocol when using IPv6 addressing. ==== - -. Optional: If you are deploying with a provisioning network, configure the IPv4 address on the provisioning network connection by running the following command: + -[source,terminal] ----- -$ nmcli connection modify provisioning ipv4.addresses 172.22.0.254/24 ipv4.method manual ----- - -. SSH back into the `provisioner` node (if required) by running the following command: +.Example NMState YAML file for a provisioning network +[source,yaml] +---- +# ... +interfaces: + - name: eth1 + type: ethernet + state: up + ipv4: + enabled: false + ipv6: + enabled: false + - name: provisioning + type: linux-bridge + state: up + ipv4: + enabled: true + dhcp: false + address: + - ip: 172.22.0.254 + prefix-length: 24 + ipv6: + enabled: true + dhcp: false + address: + - ip: fd00:1101::1 + prefix-length: 64 + bridge: + options: + stp: + enabled: false + port: + - name: eth1 +# ... +---- + +. Optional: Establish an SSH connection into the `provisioner` node by running the following command: + [source,terminal] ---- -# ssh kni@provisioner.. +# ssh kni@provisioner.. ---- ++ +where ++ +`.`:: Replace `` with the name of your cluster and `` with the fully qualified domain name (FQDN) of your cluster. . Verify that the connection bridges have been properly created by running the following command: + @@ -120,10 +197,10 @@ $ sudo nmcli con show .Example output [source,terminal] ---- -NAME UUID TYPE DEVICE -baremetal 4d5133a5-8351-4bb9-bfd4-3af264801530 bridge baremetal -provisioning 43942805-017f-4d7d-a2c2-7cb3324482ed bridge provisioning -virbr0 d9bca40f-eee1-410b-8879-a2d4bb0465e7 bridge virbr0 -bridge-slave-eno1 76a8ed50-c7e5-4999-b4f6-6d9014dd0812 ethernet eno1 -bridge-slave-eno2 f31c3353-54b7-48de-893a-02d2b34c4736 ethernet eno2 +NAME UUID TYPE DEVICE +baremetal 832f645a-9337-4afc-b48e-4a55c5779eab bridge baremetal +provisioning e7756e01-d026-4a38-b460-129afaac0ec2 bridge provisioning +Wired connection 1 49ff4c9c-db76-3139-8c18-c49fa7deb39a ethernet eth0 +Wired connection 2 c1fb12b1-88a6-3c07-93b9-187c99204c43 ethernet eth1 +lo aa030e0f-21ca-498f-b6ce-bac7d4d793f0 loopback lo ----