Skip to content

Commit e658160

Browse files
authored
Merge pull request #314311 from swethatokala/patch-1
Document multiple IP configuration for RHEL 8.6+
2 parents 9d87e4c + 285db8f commit e658160

1 file changed

Lines changed: 137 additions & 0 deletions

File tree

includes/virtual-network-multiple-ip-addresses-os-config.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,143 @@ ip route add default via 10.1.0.1 dev eth2 table custom
368368
>[!NOTE]
369369
>To configure the extra IP addresses in RHEL10.x, it's enough to restart NetworkManger with: `systemctl restart NetworkManger.service` or reboot the system. No other steps are required.
370370
371+
372+
#### RHEL 8.6 & above, RHEL 9
373+
374+
Starting RHEL 8.6 & above and RHEL 9, "networkmanager-cloud-setup" package can handle multiple IP configurations and its associated route configuration.
375+
376+
1. Disabled cloud-init to handle secondary IP configuration in the respective files /etc/cloud/cloud.cfg.d/99-apply-network-config.cfg or /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg.
377+
This will let NetworkManager and nm-cloud-setup manage the entire network configuration
378+
379+
```bash
380+
[root@rhel8 ~]# cat /etc/cloud/cloud.cfg.d/99-apply-network-config.cfg
381+
datasource:
382+
Azure:
383+
apply_network_config: False
384+
```
385+
386+
2. Install "NetworkManager-cloud-setup" package if not already installed
387+
388+
```bash
389+
]# yum install NetworkManager-cloud-setup
390+
Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs) 39 MB/s | 66 MB 00:01
391+
Red Hat Enterprise Linux 8 for x86_64 - Supplementary (RPMs) from RHUI 2.3 MB/s | 340 kB 00:00
392+
Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs) 41 MB/s | 60 MB 00:01
393+
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs) from RHUI 33 MB/s | 8.9 MB 00:00
394+
Red Hat Ansible Engine 2 for RHEL 8 x86_64 (RPMs) from RHUI 14 MB/s | 2.5 MB 00:00
395+
Dependencies resolved.
396+
==============================================================================================================================================================================================
397+
Package Architecture Version Repository Size
398+
==============================================================================================================================================================================================
399+
Installing:
400+
NetworkManager-cloud-setup x86_64 1:1.40.16-13.el8_9 rhel-8-for-x86_64-appstream-rhui-rpms 198 k
401+
Upgrading:
402+
NetworkManager x86_64 1:1.40.16-13.el8_9 rhel-8-for-x86_64-baseos-rhui-rpms 2.3 M
403+
NetworkManager-libnm x86_64 1:1.40.16-13.el8_9 rhel-8-for-x86_64-baseos-rhui-rpms 1.9 M
404+
NetworkManager-team x86_64 1:1.40.16-13.el8_9 rhel-8-for-x86_64-baseos-rhui-rpms 161 k
405+
NetworkManager-tui x86_64 1:1.40.16-13.el8_9 rhel-8-for-x86_64-baseos-rhui-rpms 356 k
406+
407+
Transaction Summary
408+
==============================================================================================================================================================================================
409+
Install 1 Package
410+
Upgrade 4 Packages
411+
412+
Total download size: 4.9 M
413+
Is this ok [y/N]: y
414+
Downloading Packages:
415+
(1/5): NetworkManager-cloud-setup-1.40.16-13.el8_9.x86_64.rpm 2.0 MB/s | 198 kB 00:00
416+
(2/5): NetworkManager-1.40.16-13.el8_9.x86_64.rpm 18 MB/s | 2.3 MB 00:00
417+
(3/5): NetworkManager-team-1.40.16-13.el8_9.x86_64.rpm 4.1 MB/s | 161 kB 00:00
418+
(4/5): NetworkManager-libnm-1.40.16-13.el8_9.x86_64.rpm 12 MB/s | 1.9 MB 00:00
419+
(5/5): NetworkManager-tui-1.40.16-13.el8_9.x86_64.rpm 8.8 MB/s | 356 kB 00:00
420+
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
421+
Total 28 MB/s | 4.9 MB 00:00
422+
Running transaction check
423+
Transaction check succeeded.
424+
Running transaction test
425+
Transaction test succeeded.
426+
Running transaction
427+
Preparing : 1/1
428+
Running scriptlet: NetworkManager-libnm-1:1.40.16-13.el8_9.x86_64 1/1
429+
Upgrading : NetworkManager-libnm-1:1.40.16-13.el8_9.x86_64 1/9
430+
Running scriptlet: NetworkManager-libnm-1:1.40.16-13.el8_9.x86_64 1/9
431+
Running scriptlet: NetworkManager-1:1.40.16-13.el8_9.x86_64 2/9
432+
Upgrading : NetworkManager-1:1.40.16-13.el8_9.x86_64 2/9
433+
Running scriptlet: NetworkManager-1:1.40.16-13.el8_9.x86_64 2/9
434+
Installing : NetworkManager-cloud-setup-1:1.40.16-13.el8_9.x86_64 3/9
435+
Running scriptlet: NetworkManager-cloud-setup-1:1.40.16-13.el8_9.x86_64 3/9
436+
Upgrading : NetworkManager-team-1:1.40.16-13.el8_9.x86_64 4/9
437+
Upgrading : NetworkManager-tui-1:1.40.16-13.el8_9.x86_64 5/9
438+
Cleanup : NetworkManager-tui-1:1.40.0-1.el8.x86_64 6/9
439+
Cleanup : NetworkManager-team-1:1.40.0-1.el8.x86_64 7/9
440+
Running scriptlet: NetworkManager-1:1.40.0-1.el8.x86_64 8/9
441+
Cleanup : NetworkManager-1:1.40.0-1.el8.x86_64 8/9
442+
Running scriptlet: NetworkManager-1:1.40.0-1.el8.x86_64 8/9
443+
Cleanup : NetworkManager-libnm-1:1.40.0-1.el8.x86_64 9/9
444+
Running scriptlet: NetworkManager-libnm-1:1.40.0-1.el8.x86_64 9/9
445+
Verifying : NetworkManager-cloud-setup-1:1.40.16-13.el8_9.x86_64 1/9
446+
Verifying : NetworkManager-1:1.40.16-13.el8_9.x86_64 2/9
447+
Verifying : NetworkManager-1:1.40.0-1.el8.x86_64 3/9
448+
Verifying : NetworkManager-libnm-1:1.40.16-13.el8_9.x86_64 4/9
449+
Verifying : NetworkManager-libnm-1:1.40.0-1.el8.x86_64 5/9
450+
Verifying : NetworkManager-team-1:1.40.16-13.el8_9.x86_64 6/9
451+
Verifying : NetworkManager-team-1:1.40.0-1.el8.x86_64 7/9
452+
Verifying : NetworkManager-tui-1:1.40.16-13.el8_9.x86_64 8/9
453+
Verifying : NetworkManager-tui-1:1.40.0-1.el8.x86_64 9/9
454+
Installed products updated.
455+
456+
Upgraded:
457+
NetworkManager-1:1.40.16-13.el8_9.x86_64 NetworkManager-libnm-1:1.40.16-13.el8_9.x86_64 NetworkManager-team-1:1.40.16-13.el8_9.x86_64 NetworkManager-tui-1:1.40.16-13.el8_9.x86_64
458+
Installed:
459+
NetworkManager-cloud-setup-1:1.40.16-13.el8_9.x86_64
460+
461+
Complete!
462+
```
463+
464+
3. To enable “nm-cloud-setup” to handle secondary IP configuration, create nm-cloud-setup.service and nm-cloud-setup.timer (adjust OnBootSec & OnUnitActiveSec parameters to suit your requirement) files
465+
466+
```bash
467+
[root@rhel8 ~]# cat /etc/systemd/system/nm-cloud-setup.service
468+
[Unit]
469+
Description=Automatically configure NetworkManager in cloud
470+
Documentation=man:nm-cloud-setup(8)
471+
Before=network-online.target
472+
After=NetworkManager.service
473+
474+
[Service]
475+
Environment=NM_CLOUD_SETUP_AZURE=yes
476+
Type=oneshot
477+
ExecStart=/usr/libexec/nm-cloud-setup
478+
479+
[Install]
480+
WantedBy=NetworkManager.service
481+
```
482+
483+
```bash
484+
[root@rhel8 ~]# cat /etc/systemd/system/nm-cloud-setup.timer
485+
[Unit]
486+
Description=Periodically run nm-cloud-setup
487+
488+
[Timer]
489+
OnBootSec=1min
490+
OnUnitActiveSec=1min
491+
492+
[Install]
493+
WantedBy=timers.target
494+
495+
```
496+
4. Enable services are reload daemon
497+
498+
```bash
499+
systemctl enable --now nm-cloud-setup.service
500+
systemctl start nm-cloud-setup.service
501+
systemctl enable --now nm-cloud-setup.timer
502+
systemctl daemon-reload
503+
```
504+
5. Reboot VM & verify. VM should now successfully identify respective primary and secondary IPs.
505+
506+
#### RHEL 8.5 & below
507+
371508
1. Open a terminal window.
372509
373510
2. Ensure you're the root user. If you aren't, enter the following command:

0 commit comments

Comments
 (0)