Set Static IP in Debian

From banana_wiki
Revision as of 14:04, 10 April 2014 by Bananafish (talk | contribs) (Created page with "really simple, but I always forget the exact syntax <pre>sudo nano /etc/network/interfaces</pre> ''may or may not need sudo, debian typically I do this as root.'' <pre>iface...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

really simple, but I always forget the exact syntax

sudo nano /etc/network/interfaces

may or may not need sudo, debian typically I do this as root.

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Next we need to restart networking so the changes take effect

sudo /etc/init.d/networking restart

You may need to bring the interface up

sudo ifup eth0

Also to change your dns server:

sudo nano /etc/resolv.conf
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30

and that is it.