Recently, I have been getting more and more interested in Linux servers and operating systems. Many people don’t realize that Linux is the most prevalent operating system in the world. It runs on all of our android devices, web servers, firewalls, backup devices, cars, and many more. I would really like to get a Linux certification, but for right now I am working on my Security+ and some others that I need to do my job. I am currently setting up a linux server and it is usually a good idea to set up a server with a static IP address. This is just one of those things that I don’t do that often and I would rather go to my own knowledge base than another knowledge base. I will be working at the command line because my server does not have a desktop environment installed. I am also using VirtualBox to configure my server and then I will export it to a vmware environment. Also, one thing that any sysadmin should do before changing a config file in any server is make sure
The first thing I like to do is find my IP address with the ifconfig command. This is the output:
The IP address I am looking for is the enp0s3. I will set my IP address statically to this. The next thing I have to do is navigate to the file that holds the information for the interfaces. The file is located at /etc/network/interfaces. The text editor I like to use is nano. I know a lot of people like vim and that is ok. If you feel more comfortable using that then that is ok.
The command will look like this: sudo nano /etc/network/interfaces
The output should look like this:
Find “# The primary network interface” and here is what you will change.
Change dhcp to static. Add address, netmask, gateway, and dns-nameservers so that it looks like this: