Network Static IP
Debian / Ubuntu
Configure network interface static IP addresses.
- Logged in as administrative user.
Configure network interfaces by creating a configuration file for each interface in the
Use the command
ip a for a list of all network interfaces on a system. Note the name of the network interface to configure. For example,
eth0 will be used.
sudo nano /etc/network/interfaces.d/eth0
Configure the interface as required by the network.
iface: The name of the interface,
address: IP address for the system.
netmask: Subnet mask for the network.
gateway: IP address of the router on the network.
dns-nameservers: Use the router address for the DHCP configured DNS servers, or specify others.
auto eth0 iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 188.8.131.52 184.108.40.206
Apply the network changes by either rebooting the system or restarting the network interface. Reboot if connected via SSH on the modified interface.
sudo ifdown eth0 && sudo ifup eth0
When using SSH, be sure to modify the SSH configuration on the client before reconnecting to the system.
sudo nano ~/.ssh/config