Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Created December 27, 2019 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruanbekker/ce5ca780a09bca7b97ab0a50122e78a3 to your computer and use it in GitHub Desktop.
Save ruanbekker/ce5ca780a09bca7b97ab0a50122e78a3 to your computer and use it in GitHub Desktop.
Set a Static IP Address for Debian Based Linux Distros

Edit the interfaces config:

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Set to:

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
	address 10.37.117.132
	netmask 255.255.255.0
	gateway 10.37.117.1

dns-nameservers 10.37.117.1 8.8.8.8

Then restart:

$ /etc/init.d/networking restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment