networking.service

The legacy Debian-style network management service, that is tied to the ifupdown system.

Configuration file: /etc/network/interfaces

Refer to NetworkManager.service for the more modern network manager.

Configuring static ip on Debian based Linux distributions (Ubuntu, Kali, Raspberry Pi OS, etc.)

  1. Edit the configuration file: /etc/network/interfaces

General configuration

auto <iface>
iface <iface> inet static
    address xxx.xxx.xx.xxx
    netmask xxx.xxx.xx.xxx
    gateway xxx.xxx.xx.xxx
    broadcast xxx.xxx.xx.xxx

    # Optional: not needed for a basic static ip address configuration
    dns-nameservers <nameserver-address>

Example

Configure network interface eth0 to have the static IP address of 192.168.1.88/24 with the default gateway address of 192.168.1.254, and broadcast address of 192.168.1.255. Optionally, the DNS nameservers can be set too (1.1.1.1 in this case).

  1. Restart the networking.service daemon

  1. Verify the configuration

Troubleshooting

If the interface fails to display the new configurations, try the following:

  1. Physically unlplug and plug the network adapter back in

  • Take note of the bright green/orange flashing light on the hardware

  • The connection is working if it's present.

  1. Manually restart the interface using the ip or ifconfig tool

  • Bring the interface down and up again

  • The bright green/orange flashing lights should be turned off when the interface is brought down, and will come back up again when the interface is brought up

Last updated