By default, our system’s IP address in Debian is obtained through DHCP, however, you can modify it and assign it a static IP address using the following steps:
- Edit the following file with nano, /etc/network/interfaces.
nano /etc/network/interfaces
Change
#The primary network interface
allow-hotplug eth0
iface eth0 inet dchp
With the following.
#The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
Save and Exit
- Enable the interface.
ifup eth0
- It is recommended to restart the server.
reboot