How to change the IP address of the server?
The first thing we need is to access the console, as we saw in the previous step.
Once inside, what we are going to do is edit the interfaces file that contains the network connection settings. The command that we must write in the console is the following:
sudo nano / etc / network / interfaces
Then press “Enter” and enter the following screen:
Here we are shown the ip that it has set (192.168.1.40), the netmask (255.255.255.0) and the gateway (192.168.1.100).
Below, the configuration of the Wi-Fi ip (client mode) is also shown, we will not touch these parameters.
We change the Ip 192.168.1.40 for the one we want to assign, bearing in mind that the segment must match for the gateway, that is; If our network segment is in the 192.168.0.X range, we must also change it in the gateway.
- address 192.168.0.35
- netmask 255.255.255.0
- gateway 192.168.0.100
The gateway and the ip address are on the same segment.
To exit the window we press “Ctrl + X” and it asks us to confirm the changes, we press the “Y” key and then the “Enter” key.
With this, it only remains to restart the server.