How to set static IP in Debian
From Kolmisoft Wiki
Jump to navigationJump to search
/sbin/ifconfig eth0 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255 invoke-rc.d network restart
Configuration is in /etc/network/interfaces
Another Way
1) Edit the /etc/network/interfaces file
Set the static IP changing the network interface that you need (Example ETH0)
# The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.0.30 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1
Save the file
2) Edit the /etc/resolv.conf file and add the DNS servers that you need
nameserver 200.83.1.5 nameserver 200.83.1.4 nameserver 146.83.126.8 nameserver 200.73.13.150 nameserver 200.73.13.50
Save the file
3) Restart the network or your computer (I recommend to reboot the computer)