Quick Tip: Configure Static IP in Centos 6.5
In this small tutorial, I will show you how to convert from DHCP to Static IP address.
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 HWADDR=08:00:27:76:4c:d5 TYPE=Ethernet ONBOOT=yes BOOTPROTO=none IPV6INIT=no USERCTL=no NM_CONTROLLED=yes PEERDNS=yes IPADDR=192.168.1.140 NETMASK=255.255.255.0
Configure Default Gateway
# vi /etc/sysconfig/network
NETWORKING=yes HOSTNAME=centos6 GATEWAY=192.168.1.1
Configure DNS Server
# vi /etc/resolv.conf
nameserver 184.108.40.206 # Replace with your DNS1 nameserver 192.168.1.1 # Replace with your DNS2
Restart Network Interface
# /etc/init.d/network restart
eth0 Link encap:Ethernet HWaddr 08:00:27:76:4C:D5 inet addr:192.168.1.140 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe76:4cd5/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:366 errors:0 dropped:0 overruns:0 frame:0 TX packets:252 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:34247 (33.4 KiB) TX bytes:27082 (26.4 KiB)
Check the Connectivity
[root@centos6 ~]# ping centos.org
PING centos.org (220.127.116.11) 56(84) bytes of data. 64 bytes from 18.104.22.168: icmp_seq=1 ttl=56 time=10.2 ms 64 bytes from 22.214.171.124: icmp_seq=2 ttl=56 time=11.0 ms ^C --- centos.org ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1596ms rtt min/avg/max/mdev = 10.233/10.623/11.013/0.390 ms
[root@centos6 ~]# nslookup centos.org Server: 126.96.36.199 Address: 188.8.131.52#53 Non-authoritative answer: Name: centos.org Address: 184.108.40.206
For questions please refer to our Q/A forum at : http://ask.unixmen.com/
Like us on Facebook
Donate to Unixmen
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04 : Power Commands, power management application created by the Atareao team , this app helps users to...0 comments |
- Install Uget Download Manager In Ubuntu, Fedora, Debian : uGet is a very light-weight and powerful open source download manager. On March 4th, 2014 Uget Do...0 comments |
- Install Crashplan backup tool in Linux : CashPlan is an automated backup solution that either uses the CrashPlan Central server or any other ...0 comments |
- Download Elementary OS 'Luna' Official Wallpapers : Hi Guys, Am a great lover of Elementary OS, so I like to move almost everywhere with some its beaut...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
- New Games got Greenlit on Linux by Steam Today!
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .
Maintained by Unixmen .