Informational Website publish

Blog

News about our company, tutorials about IT and much more you will find in this page.

How to Configure Static IP Address Protocol (IPv4)

Janeiro 30th, 2018

To configure static IP Address, you need to update or edit network configuration file to assign an Static IP Address to a system. You must be superuser with su (switch user) command from terminal or command prompt.
For RHEL/CentOS/Fedora

Open and edit network configuration file for (eth0 or eth1) using your favorite editor. For example, to assigning IP Address to eth0 interface as follows.

  • vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.50.2
NAME="System eth0"
HWADDR=00:0C:29:28:FD:4C
GATEWAY=192.168.50.1

For Ubuntu/Debian/Linux Mint

Assign Static IP Address to eth0 interface editing configuration file /etc/network/interfaces to make permanent changes as shown below.

  • nano /etc/network/interfaces
auto eth0 
iface eth0 inet static
address 192.168.50.2
netmask 255.255.255.0
gateway 192.168.50.1

Next, restart network services after entering all the details using the following command.

  • sudo /etc/init.d/networking restart