Konfigurasi IP addres static pada linux debian
2 min read
3 months ago
Published on Nov 24, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
This tutorial will guide you through the process of configuring a static IP address on a Debian Linux system. Setting a static IP can be essential for servers and network devices that require a consistent network address. By following this step-by-step guide, you will learn how to ensure your Debian system retains the same IP address across reboots.
Step 1: Access the Terminal
- Open the terminal on your Debian system. You can do this by searching for "Terminal" in the application menu or using the keyboard shortcut
Ctrl + Alt + T.
Step 2: Identify Your Network Interface
- Determine the name of your network interface. You can use the following command:
ip addr - Look for an entry like
eth0,enp0s3, or similar under thelink/ethersection. Note the interface name you will be configuring.
Step 3: Backup the Current Configuration
- Before making changes, it's a good idea to back up your existing network configuration file. Use the command:
sudo cp /etc/network/interfaces /etc/network/interfaces.bak
Step 4: Edit the Network Configuration File
- Open the network interfaces configuration file using a text editor. For example, with
nano, run:sudo nano /etc/network/interfaces - Locate the section for your network interface. It may look something like this:
auto eth0 iface eth0 inet dhcp - Change
dhcptostaticand add the following lines, replacing the values with your desired IP address, subnet mask, and gateway:iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1
Step 5: Save Changes and Exit
- To save your changes in
nano, pressCtrl + O, thenEnter. To exit, pressCtrl + X.
Step 6: Restart Networking Service
- After editing the configuration file, restart the networking service to apply the changes with the following command:
sudo systemctl restart networking
Step 7: Verify the Configuration
- Check that your static IP address has been successfully applied. Use the command:
ip addr - Confirm that the output shows the static IP address you configured.
Conclusion
You have successfully configured a static IP address on your Debian Linux system. By following these steps, your device will maintain the same IP address, which is crucial for network stability. As a next step, consider setting up firewall rules or installing additional network services based on your requirements.