Jump to content

How to change CN network settings from command line without accessing web UI in KATA 5.+ [KATA/KEDRE]


Recommended Posts

Versions

Applicable to versions later than 5.0, 5.1, 6.0, 6.0.1, etc.

Advice and Solutions (Forum Knowledgebase) Disclaimer. Read before using materials.

Problem

There are several cases where the standard method of changing interface network settings via the Web UI is not available, e.g. the Web UI is inaccessible.

Solution

Become root, save the nodes settings:

sudo su
console-settings-updater get /deploy/deployment_api/nodes | python3 -m json.tool > /tmp/nodes

Open the saved file for editing:

vim /tmp/nodes

Locate the desired network_settings, ifaces node, change the values tat you need to change:

{
    "cc2cx0fltsjmxolid99p5loen": {
        "id": 1,
        "hostname": "1.srv.node1.node.dyn.kata",
...
        "network_settings": {
            "ifaces": [
                {
                    "iface_name": "ens160",
                    "configuration_type": "static",
                    "span": false,
                    "address": "10.68.56.215",
                    "netmask": "255.255.254.0",
                    "gateway": "10.68.56.1",
                    "mac": "00:50:56:a5:39:f6"
                },
                {
                    "iface_name": "ens192",
                    "configuration_type": "static",
                    "address": "100.100.100.100",
                    "netmask": "255.255.255.0",
                    "gateway": "100.100.100.1",
                    "mac": "00:50:56:a2:5a:f6"
                }
            ]
        }
    }
}

Save your changes and exit Vim. Verify that the JSON structure is valid (the command returns no errors):

cat /tmp/nodes | python3 -m json.tool

Import the modified settings back:

console-settings-updater set /deploy/deployment_api/nodes @/tmp/nodes
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...