Debian: Set Static IP: Difference between revisions
From wiki.jacobjohns.com
jwiki>jjohns Created |
m 4 revisions imported |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
[[File:Debian logo.png|center|frameless]] | [[File:Debian logo.png|center|frameless]] | ||
<hr /><br /> | |||
#Backup the original interfaces file to desired backup location. | #Backup the original interfaces file to desired backup location. | ||
#*<code>cp /etc/network/interfaces /usr/bu</code> | #*<code>cp /etc/network/interfaces /usr/bu</code> | ||
Latest revision as of 16:06, 27 July 2024
- Backup the original interfaces file to desired backup location.
cp /etc/network/interfaces /usr/bu
- Modify the original file, configuring:
iface <interface> inet staticaddress <desired static ip>netmask <netmask>gateway <gateway>dns-nameservers <nameserver ip> <nameserver ip>
- Save the file and restart the networking service.
systemctl restart networking.service
- Confirm the IP address with
ip a. - The interfaces file should resemble the below.
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface # allow-hotplug ens192 # iface ens192 inet dhcp auto ens192 iface ens192 inet static address 10.168.123.234 netmask 255.255.0.0 gateway 10.168.11.300 dns-nameservers 1.0.0.1 1.0.0.3
