Set Static IP Address on Deb 12
Set Static IP Address¶
To change the IP address on Deb 12, you can configure a static IP address either by:
- Editing
/etc/network/interfaces(used on older systems or when avoiding NetworkManager) - Using tools like
nmclior a graphical interface if NetworkManager is installed
Below is the method using the traditional /etc/network/interfaces approach.
Know your Interface Name First
Use the following command to identify your network interface name (e.g., eth0, enp0s3):
Method 1: Using /etc/network/interfaces (Traditional Server Configuration)¶
This is a manual configuration approach suitable for servers or systems without NetworkManager.
🛡️ Step-by-step Instructions¶
-
Find your interface name:
-
Backup your current config:
-
Edit the network configuration file:
-
Add or modify the configuration:
Replace
enp0s3, IP, netmask, gateway, and DNS as per your actual network details. -
Apply the changes:
You can restart the networking service or the specific interface:
Make sure you have console access
Misconfiguration can lead to loss of network access. Always ensure you have a way to revert if needed, especially when working remotely.
Additional Methods¶
For systems using NetworkManager, consider using:
nmcli(command-line)- NetworkManager GUI (
nmtuior desktop interface)