{"id":4873,"date":"2014-03-30T12:33:07","date_gmt":"2014-03-30T04:33:07","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4873"},"modified":"2023-04-28T09:48:19","modified_gmt":"2023-04-28T09:48:19","slug":"how-to-configure-static-ip-address-and-set-hostname-on-fedora-20","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-static-ip-address-and-set-hostname-on-fedora-20\/","title":{"rendered":"How to Configure Static IP Address and Set Hostname on Fedora 20"},"content":{"rendered":"<p>This post will show the step to set the hostname and configure static IP address to the server. DHCP is not recommended if you plan to run this fedora 20 as a server. By default in Fedora 20, ifconfig command is not installed automatically. You should install net-tools package, it includes ifconfig and netstat.<\/p>\n<p>ifconfig not installed by default :<\/p>\n<pre>\n[root@localhost ~]# ifconfig\n-bash: ifconfig: command not found\n<\/pre>\n<p>1. Install net-tools, it will include ifconfig :<\/p>\n<pre>\n[root@localhost ~]# yum install net-tools -y\nfedora\/20\/x86_64\/metalink                                                    | 8.7 kB  00:00:01\nfedora                                                                       | 3.8 kB  00:00:01\nupdates\/20\/x86_64\/metalink                                                   | 5.0 kB  00:00:00\nupdates                                                                      | 4.9 kB  00:00:00\n(1\/4): fedora\/20\/x86_64\/group_gz                                             | 394 kB  00:00:37\n(2\/4): updates\/20\/x86_64\/group_gz                                            | 394 kB  00:00:43\n(3\/4): updates\/20\/x86_64\/primary_db                                          | 8.8 MB  00:03:22\n(4\/4): fedora\/20\/x86_64\/primary_db                                           |  18 MB  00:04:35\n(1\/2): updates\/20\/x86_64\/pkgtags                                             | 1.0 MB  00:00:09\n(2\/2): updates\/20\/x86_64\/updateinfo                                          | 920 kB  00:00:18\nResolving Dependencies\n--> Running transaction check\n---> Package net-tools.x86_64 0:2.0-0.15.20131119git.fc20 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package             Arch             Version                                Repository        Size\n====================================================================================================\nInstalling:\n net-tools           x86_64           2.0-0.15.20131119git.fc20              fedora           308 k\n\nTransaction Summary\n====================================================================================================\nInstall  1 Package\n\nTotal download size: 308 k\nInstalled size: 937 k\nDownloading packages:\nwarning: \/var\/cache\/yum\/x86_64\/20\/fedora\/packages\/net-tools-2.0-0.15.20131119git.fc20.x86_64.rpm: Header V3 RSA\/SHA256 Signature, key ID 246110c1: NOKEY\nPublic key for net-tools-2.0-0.15.20131119git.fc20.x86_64.rpm is not installed\nnet-tools-2.0-0.15.20131119git.fc20.x86_64.rpm                               | 308 kB  00:00:10\nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora-20-x86_64\nImporting GPG key 0x246110C1:\n Userid     : \"Fedora (20) <fedora @fedoraproject.org>\"\n Fingerprint: c7c9 a9c8 9153 f201 83ce 7cba 2eb1 61fa 2461 10c1\n Package    : fedora-release-20-1.noarch (@anaconda)\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora-20-x86_64\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : net-tools-2.0-0.15.20131119git.fc20.x86_64                                       1\/1\n  Verifying  : net-tools-2.0-0.15.20131119git.fc20.x86_64                                       1\/1\n\nInstalled:\n  net-tools.x86_64 0:2.0-0.15.20131119git.fc20\n\nComplete!\n<\/fedora><\/pre>\n<p>2. How to set the hostname :<\/p>\n<pre>\n[root@localhost ~]# vi \/etc\/hostname\n<\/pre>\n<p>Update to the preferred hostname :<\/p>\n<pre> \nfedora20.ehowstuff.local\n<\/pre>\n<p>3. Verify the interface name. In my case, the auto assigned interface for my ip address was ifcfg-ens32. It could be different from your server :<\/p>\n<pre>\n[root@localhost ~]# ls \/etc\/sysconfig\/network-scripts\/\nifcfg-ens32  ifdown-isdn    ifup-aliases  ifup-plip    ifup-wireless\nifcfg-lo     ifdown-post    ifup-bnep     ifup-plusb   init.ipv6-global\nifdown       ifdown-ppp     ifup-eth      ifup-post    network-functions\nifdown-bnep  ifdown-routes  ifup-ippp     ifup-ppp     network-functions-ipv6\nifdown-eth   ifdown-sit     ifup-ipv6     ifup-routes\nifdown-ippp  ifdown-tunnel  ifup-ipx      ifup-sit\nifdown-ipv6  ifup           ifup-isdn     ifup-tunnel\n<\/pre>\n<p>4. Configure static IP address :<\/p>\n<pre>\n[root@localhost ~]# vi \/etc\/sysconfig\/network-scripts\/ifcfg-ens32\n<\/pre>\n<p>The original configuration file :<\/p>\n<pre>\nTYPE=\"Ethernet\"\nBOOTPROTO=\"dhcp\"\nDEFROUTE=\"yes\"\nIPV4_FAILURE_FATAL=\"no\"\nIPV6INIT=\"yes\"\nIPV6_AUTOCONF=\"yes\"\nIPV6_DEFROUTE=\"yes\"\nIPV6_PEERDNS=\"yes\"\nIPV6_PEERROUTES=\"yes\"\nIPV6_FAILURE_FATAL=\"no\"\nNAME=\"ens32\"\nUUID=\"8f3bcce9-631f-4874-a642-c78b2badb94d\"\nONBOOT=\"yes\"\nHWADDR=\"00:0C:29:8C:7B:FE\"\nPEERDNS=\"yes\"\nPEERROUTES=\"yes\"\n<\/pre>\n<p>Change to below :<\/p>\n<pre>\nTYPE=\"Ethernet\"\nBOOTPROTO=\"none\"\nDEFROUTE=\"yes\"\nIPV4_FAILURE_FATAL=\"no\"\nIPV6INIT=\"yes\"\nIPV6_AUTOCONF=\"yes\"\nIPV6_DEFROUTE=\"yes\"\nIPV6_PEERDNS=\"yes\"\nIPV6_PEERROUTES=\"yes\"\nIPV6_FAILURE_FATAL=\"no\"\nNAME=\"ens32\"\nUUID=\"8f3bcce9-631f-4874-a642-c78b2badb94d\"\nONBOOT=\"yes\"\nHWADDR=\"00:0C:29:8C:7B:FE\"\nPEERDNS=\"yes\"\nPEERROUTES=\"yes\"\nIPADDR=\"192.168.0.20\"\nNETMASK=\"255.255.0.0\"\nGATEWAY=\"192.168.0.1\"\n<\/pre>\n<p>5. Disable network manager and use the simple network service :<\/p>\n<pre>\n[root@localhost ~]# systemctl disable NetworkManager.service\nrm '\/etc\/systemd\/system\/dbus-org.freedesktop.NetworkManager.service'\nrm '\/etc\/systemd\/system\/dbus-org.freedesktop.nm-dispatcher.service'\nrm '\/etc\/systemd\/system\/multi-user.target.wants\/NetworkManager.service'\n<\/pre>\n<pre>\n[root@localhost ~]# systemctl start network.service\n[root@localhost ~]# chkconfig network on\n<\/pre>\n<p>6. Reboot server :<\/p>\n<pre>\n[root@localhost ~]# reboot\n<\/pre>\n<p>7. Once rebooted, verify the updated hostname and ip address :<\/p>\n<pre>\n[root@fedora20 ~]# hostname\nfedora20.ehowstuff.local\n[root@fedora20 ~]# ifconfig\nens32: flags=4163<up ,BROADCAST,RUNNING,MULTICAST>  mtu 1500\n        inet 192.168.0.20  netmask 255.255.0.0  broadcast 192.168.255.255\n        inet6 fe80::20c:29ff:fe8c:7bfe  prefixlen 64  scopeid 0x20<link \/>\n        ether 00:0c:29:8c:7b:fe  txqueuelen 1000  (Ethernet)\n        RX packets 335  bytes 34848 (34.0 KiB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 322  bytes 28792 (28.1 KiB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\nlo: flags=73<\/up><up ,LOOPBACK,RUNNING>  mtu 65536\n        inet 127.0.0.1  netmask 255.0.0.0\n        inet6 ::1  prefixlen 128  scopeid 0x10<host>\n        loop  txqueuelen 0  (Local Loopback)\n        RX packets 0  bytes 0 (0.0 B)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 0  bytes 0 (0.0 B)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n<\/host><\/up><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post will show the step to set the hostname and configure static IP address to the server. DHCP is not recommended if you plan to run this fedora 20&#8230;<\/p>\n","protected":false},"author":6,"featured_media":2351,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2057],"tags":[1373,1536],"class_list":["post-4873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fedora","tag-fedora-20","tag-linux"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4873"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4873\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/2351"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}