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
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.
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=220.127.116.11 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
That’s all. We have successfully configure static ip address on Fedora 28 Server. See you on the next tutorial.