Introduction
In this blog post we will change the IP address of a Wazuh machine. This will keep the IP address static even after a reboot. So now we will walk through the steps to configure a static IP address for the Wazuh machine.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A Wazuh machine running on your network.
- Access to the Wazuh machine with administrative/root privileges.
- Basic knowledge of Linux command line and network configuration.
Steps
Make sure the wazuh machine is turned on and log on to the machine.
Step 1: Check the current version of the machine.
| Bash |
|---|
|
This command will display the operating system information.
look for the line that starts with "Pretty_Name" to see the current version of the OS.
Pretty_Name="Amazon Linux 2023.x.xxxxxxxx"
Once you have the current version information, and matches the expected version, you can
proceed to the next step.
Step 2: Configuring the IP address
-
Login:
- Login to the wazuh machine.
-
System Updates:
- Ensure that the Wazuh instance is up to date by running the latest updates.
-
Configuration:
-
Navigate to the following path to edit the network configuration file:
/etc/systemd/network -
Create a new file "05-static-eth0.network" using the command:
Here im using vim editor you can use any editor of your choice.sudo vim /etc/systemd/network/05-static-eth0 -
Add the following configuration to set a static IP address:
[Match] Name=eth0 [Network] Address=192.168.0.200/24 Gateway=192.168.0.1 DNS=8.8.8.8 DNS=1.1.1.1
-
Navigate to the following path to edit the network configuration file:
- save and exit the file. press "ESC" and type ":wq" to save and exit the file.
-
Restart the machine to apply the changes using the command:
sudo reboot - This will restart the Wazuh machine, and upon reboot, it will have the new static IP address configured.
- SSH into the machine using the new IP address to verify that the changes were applied successfully.
Conclusion
In this blog post, we have successfully changed the IP address of a Wazuh machine to a static IP
address. By following the steps outlined above, you can ensure that your Wazuh machine retains
its IP address even after a reboot, which is essential for consistent network communication and
management.
Feel free to leave any questions or feedback in the comments below.