Changing the IP Address of a Samba Domain Controller

**NethServer Version:8

I want to change the IP address of an already set-up Samba domain controller. How should I configure it?

I changed the IP address of AlmaLinux 9, which is hosting NethServer 8, and updated the new IP address in /home/samba1/.config/state/environment. After rebooting, I was able to access the NethServer 8 web UI with the new IP address. However, when I checked the IP address of the Samba provider, it still had the old information, and I could not reference the user information.

I know you asked this a while back. Maybe this is what your looking for. Hope it helps.

Thanks,
-SF-

Thank you very much for your response and the assistance you provided.
I am truly grateful for your help.

[root@al93ns8org99 ~]# api-cli run module/samba1/set-ipaddress --data ‘{“192.168.100.xx”:“ip”}’
Warning: using user “cluster” credentials from the environment
Validation errors: [(root): ipaddress is required]
[{“parameter”: “(root)”, “error”: “(root)_required”, “value”: {“192.168.100.xx”: “ip”}, “field”: “(root)”}]

Is it correct to run these commands on the Nethserver host, or should they be run elsewhere?

The reason I sent that to you is because that is what I was going through yesterday and I came across your poset and it looked like the same issue and thought I would pass it along.

Also, what is the underlining OS Linux distro of your device. Mine is debian. I had to do this in root. So I had to do

su -

and login as root. I figure you are probably in root doing this. but just in case I thought I would add that.

I fixed the issue yesterday with @davidep 's help. Go ahead and read through the following post. The solution is close to the end. Here is the post you should read.

Hope it helps

-SF-

Hi @ntk725, the above command inverts the expected order of “ip” and “192.168.100.xx”. It is not the JSON object the action expects and prints the error: Validation errors: [(root): ipaddress is required].

As Jeff says, you’ve to be root to run a command like the following (replace your IP):

api-cli run module/samba1/set-ipaddress --data '{"ipaddress":"192.168.1.123"}'

The manual section, which had a typo, has been fixed now: NethServer 7 migration — NS8 documentation.

1 Like

Trying to set up a new instance of samba-dc, but it´s created on the wg-vpn-ip and 127.0.0.1, very convenient if you try to access it from the lan…
Trying to set it up to accept the local ip with

$ api-cli run module/samba4/set-ipaddress --data ‘{“ipaddress”:“192.168.178.66”}’
Warning: using user “cluster” credentials from the environment
“[{"field":"ipaddress","parameter":"ipaddress","value":""192.168.178.66"","error":"peer_dc_found"}]\n”

Why is the local ip excluded by default? Can´t change the set ip…

Hello .. unfortunately this syntax is not working for me … maybe typo somewhere

[root@nh8 ~]# api-cli run module/samba1/set-ipaddress --data ‘{“ipaddress”: 1.2.3.4}’
Traceback (most recent call last):
File “/usr/local/bin/api-cli”, line 257, in
exit_code = command(args)
^^^^^^^^^^^^^
File “/usr/local/bin/api-cli”, line 121, in run_command
data = json.loads(args.data)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib64/python3.11/json/_init_.py”, line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib64/python3.11/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib64/python3.11/json/decoder.py”, line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ‘,’ delimiter: line 1 column 18 (char 17)
[root@nh8 ~]#

I’ve tried many combinations but no success so far

I kindly ask for support

Thank you very much in advance

BR

You forgot the quotation marks for the IP address and the discourse forum converts straight quotes into curly quotes which are not working.

Wrong: api-cli run module/samba1/set-ipaddress --data ‘{“ipaddress”: 1.2.3.4}’

Right: api-cli run module/samba1/set-ipaddress --data '{"ipaddress":"1.2.3.4"}'
2 Likes

Yes .. thank you very much … Migration nh7 → nh8 successful !

2 Likes