How to configure static IP in debian

Debian, also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. http://debian.org


Linux distribution nowadays come with fully functional desktop. In the last few years the Linux desktop has improved a lot and now you can use it without using the command line at all. But command line is still the best and more powerful way to work with Linux OS.

Today, I will talk about changing and setting up a Network IP address using command line. If you have desktop version of Debian you still can use the command line. User Terminal application for command line access.

Login

Open Terminal, Login in to your system and type the following command

Text Editor

root@debian:~ $ sudo nano /etc/network/interfaces

Once the interfaces file opens, for static ip follow the following syntax.

auto lo
iface lo inet loopback

iface eth0 inet dhcp

iface eth1 inet static

address 192.168.1.5
mask 255.255.255.0
gateway 192.168.1.1

Save the file

Save the file when you are done. Following steps are needed to save the file

Ctrl + X
yes
Enter

Restart

After saving the file, restart the system. Type following command to restart

root@debian:~ $ sudo reboot now

Conclusion

The system is setup to connect to a network using static ip address. Now you can connect using ssh to your debian system or use Winscp to see Linux filesystem from Windows OS.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.