Skip to content
Search Oracle Linux

    Browse this documentation

    nmcli static IP and NetworkManager basics: the full measured chain from creating a profile to persisting it

    OL 9/10’s network-management entry point is NetworkManager + nmcli (ifcfg files are history). This page measures a safe static IP flow — create the profile, read it back, verify, then activate — never locking yourself out mid-way.

    Terminal window
    nmcli device status # the device view: ens18 ethernet connected
    nmcli con show # the connection view: ens18 (UUID bound to the device)

    Concept alignment: a device is hardware, a connection (profile) is configuration. A device applies at most one profile at a time; a profile can be reused across devices. The ens18 profile preinstalled on a minimal OL install was generated by the installer via DHCP.

    The safe static IP flow: create, verify, then activate

    Section titled “The safe static IP flow: create, verify, then activate”
    Terminal window
    nmcli con add type ethernet con-name ol-demo ifname ens18 \
    ipv4.method manual ipv4.addresses 192.168.50.99/24 \
    ipv4.gateway 192.168.50.1 ipv4.dns 223.5.5.5 autoconnect no

    Measured output: Connection 'ol-demo' successfully added. At this point the running network is untouched (autoconnect=no). Read back to verify:

    Terminal window
    nmcli -g ipv4.addresses,ipv4.gateway,ipv4.dns,connection.autoconnect con show ol-demo
    # 192.168.50.99/24
    # 192.168.50.1
    # 223.5.5.5
    # no

    Persistence confirmed (keyfile format):

    Terminal window
    ls /etc/NetworkManager/system-connections/
    # ens18.nmconnection ol-demo.nmconnection
    Terminal window
    nmcli con up ol-demo # take effect (SSH drops for a moment if the IP changes — mind your out-of-band channel)
    nmcli con down ol-demo && nmcli con up ens18 # roll back to the original profile
    TaskCommand
    View the effective IPip -br addr
    Change DNSnmcli con mod <name> ipv4.dns "223.5.5.5 119.29.29.29"
    DHCP → staticipv4.method manual + ipv4.addresses
    Delete a profilenmcli con delete <name>
    Apply after manual editsnmcli con reload + nmcli con up <name>
    • Measured: the full profile create/read-back/persist/cleanup chain (the non-activating path) (E3);
    • Not measured: actually switching with con up on the static IP (would drop the lab machine’s network; to be added once an out-of-band channel is available);
    • Sources: OL10 networking documentation, nmcli(1), nm-settings-keyfile(5).