How to Configure Static IP Address on Fedora 28 Server

In some cases, you may need to configure static IP address on your Fedora 28 Server. If you are going to dedicate the Fedora 28 Server for your network file server, MySQL Server or even a web server, it is advisable to change the IP to static. This short tutorial will show you how to configure static IP address on Fedora 28 Server. 

Step 1. Check the available network interface on the server

Execute this command to list all available network interface on your server

ifconfig -a

Output:

As you can see, my server has two available network interface: enp0s3 and lo. We will configure the enp0s3 as our main network interface. 

Step 2. Change the IP address

Now, we are going to configure the enp0s3 interface. We need to edit the file /etc/sysconfig/network-scripts/ifcfg-enp0s3.

nano /etc/sysconfig/network-scripts/ifcfg-enp0s3

Output:

This is the default value of the ifcfg-enp0s3 file. 

Change it into something like this:

TYPE=Ethernet
# Static IP Address #
BOOTPROTO=none
# Server IP #
IPADDR=192.168.1.50
# Netmask #
NETMASK=255.255.255.0
# Default Gateway IP #
GATEWAY=192.168.1.1
# DNS Servers #
DNS1=192.168.1.1
DNS2=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
# Disable ipv6 #
IPV6INIT=no
# Device Name #
NAME=enp0s3
DEVICE=enp0s3
# Activate on Boot #
ONBOOT=yes
# Default Domain Search #
DOMAIN=manjarosite.local

Now close and save the file. Then, verify the new static IP address with ifconfig -a command

ifconfig -a

Output

configure static ip address on Fedora 28 Server

That’s all. We have successfully configure static ip address on Fedora 28 Server. See you on the next tutorial.

1 Comment

Leave a Reply

Your email address will not be published.


*


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