- Advertisement -

If you are a Linux system administrator, time will come when you will need to configure networking on your system. Unlike desktop machines where you can use dynamic IP addresses, on a server infrastructure, you will need to setup a static IP address (at least in most cases).

IP address: Netmask: Hostname: node01.tecmint.com Domain name: demodomain.com Gateway: DNS Server 1: DNS Server 2:

Configure Static IP Address in RHEL/CentOS/Fedora:

To configure static IP address in RHEL / CentOS / Fedora, you will need to edit:

Where in the above “ifcfg-eth0″ answers to your network interface eth0. If your interface is named “eth1” then the file that you will need to edit is “ifcfg-eth1”.

Let’s start with the first file:

- Advertisement -

Open that file and set:

Next open:

Note: Make sure to open the file corresponding to your network interface. You can find your network interface name with ifconfig -a command.

In that file make the following changes:

You will only need to edit the settings for:

DNS1 and DNS2

Other settings should have already been predefined.

Next edit resolve.conf file by opening it with a text editor such as nano or vi:

Once you have made your changes restart the networking with:

Set Static IP Address in Debian / Ubuntu

To setup static IP address in Debian/ Ubuntu, open the following file:

You may see a line looking like this:

Change it so it looks like this:

Save the file and then edit /etc/resolv.conf like this:

Restart the networking on your system with:

Your static IP address has been configured.

You now know how to configure a static IP address on a Linux distro. If you have any questions or comments, please do not hesitate to submit them in the comment section below.

- Advertisement -

There are no comments yet

  • Hello, guest