How to Configure Static IP Address on Linux Fedora 16 Server

This post will show the quick steps to configure static ip address on linux Fedora 16 server. By default the linux Fedora 16 server will auto get the ip from DHCP server. DHCP is not recommended if you use as a server. This steps including the configuration of ip address, netmask, gateway and dns server.

Open network configuration file as below :

[root@fedora16 ~]# vi /etc/sysconfig/network-scripts/ifcfg-p3p1

At first, the setting will look like this :

DEVICE="p3p1"
HWADDR="00:0C:29:6F:37:B5"
BOOTPROTO="dhcp"
ONBOOT="yes"
NM_CONTROLLED="yes"

This examples shows how you can configure static ip address, netmask and dns server on Fedora 16 server :

DEVICE="p3p1"
HWADDR="00:0C:29:6F:37:B5"
BOOTPROTO="none"
ONBOOT="yes"
NM_CONTROLLED="yes"
IPADDR=192.168.1.47
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=8.8.4.4
TYPE=Ethernet
IPV6INIT=no
USERCTL=no

Configure the server gateway :

[root@fedora16 ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fedora16.ehowstuff.com
GATEWAY=192.168.1.1

Start the network service :

[root@fedora16 ~]# systemctl restart network.service

Set network auto start at boot :

[root@fedora16 ~]# chkconfig network on

Comments

3 Comments

  • Avatar Leslie Satenstein says:

    Another way is to modify the router to recognize the mac address and to respond appropriately

  • Avatar Rororunner says:

    when I input this “systemctl restart network.service”
    the status will be like this:
    Job Failed. See system logs and ‘systemctl status’ for details

    what can I do?

  • Avatar mhstar says:

    May i know what is inside your logs ?

Leave a Reply

Your email address will not be published. Required fields are marked *