Configuring IP Address on Centos 6.7

CK CK 3788 
Created at
Updated at  
790 0 0

On Centos 6.7, you can check IP address configuration by ifconfig command as below:

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:4C:68:00:67
          inet addr:192.168.10.9  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe68:67/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:288051 errors:0 dropped:0 overruns:0 frame:0
          TX packets:461463 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24436277 (23.3 MiB)  TX bytes:599160385 (571.4 MiB)

eth1      Link encap:Ethernet  HWaddr 00:E0:4C:68:00:68
          inet addr:192.168.10.9  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

 

The below is the example of files on "/etc/sysconfig/network-scripts"

# cd /etc/sysconfig/network-scripts
# cd ls -Fal
total 220
drwxr-xr-x. 2 root root 4096 Oct 31 06:52 ./
drwxr-xr-x. 7 root root 4096 Nov 2 21:50 ../
-rw-r--r--. 1 root root 180 Oct 31 06:52 ifcfg-eth0
-rw-r--r--. 1 root root 180 Oct 31 06:44 ifcfg-eth1
-rw-r--r--. 1 root root 254 Apr 10 2015 ifcfg-lo
-rw-r--r--. 1 root root 137 Oct 31 06:34 ifcfg-wlan0
lrwxrwxrwx. 1 root root 20 Oct 31 06:34 ifdown -> ../../../sbin/ifdown*
-rwxr-xr-x. 1 root root 627 Apr 10 2015 ifdown-bnep*
-rwxr-xr-x. 1 root root 5594 Apr 10 2015 ifdown-eth*
-rwxr-xr-x. 1 root root 781 Apr 10 2015 ifdown-ippp*
-rwxr-xr-x. 1 root root 4168 Apr 10 2015 ifdown-ipv6*
lrwxrwxrwx. 1 root root 11 Oct 31 06:34 ifdown-isdn -> ifdown-ippp*
-rwxr-xr-x. 1 root root 1617 Apr 10 2015 ifdown-post*
-rwxr-xr-x. 1 root root 1064 Apr 10 2015 ifdown-ppp*
-rwxr-xr-x. 1 root root 835 Apr 10 2015 ifdown-routes*
-rwxr-xr-x. 1 root root 1465 Apr 10 2015 ifdown-sit*
-rwxr-xr-x. 1 root root 1434 Apr 10 2015 ifdown-tunnel*
lrwxrwxrwx. 1 root root 18 Oct 31 06:34 ifup -> ../../../sbin/ifup*
-rwxr-xr-x. 1 root root 12589 Apr 10 2015 ifup-aliases*
-rwxr-xr-x. 1 root root 859 Apr 10 2015 ifup-bnep*
-rwxr-xr-x. 1 root root 10948 Apr 10 2015 ifup-eth*
-rwxr-xr-x. 1 root root 11971 Apr 10 2015 ifup-ippp*
-rwxr-xr-x. 1 root root 10490 Apr 10 2015 ifup-ipv6*
lrwxrwxrwx. 1 root root 9 Oct 31 06:34 ifup-isdn -> ifup-ippp*
-rwxr-xr-x. 1 root root 727 Apr 10 2015 ifup-plip*
-rwxr-xr-x. 1 root root 954 Apr 10 2015 ifup-plusb*
-rwxr-xr-x. 1 root root 2364 Apr 10 2015 ifup-post*
-rwxr-xr-x. 1 root root 4154 Apr 10 2015 ifup-ppp*
-rwxr-xr-x. 1 root root 1925 Apr 10 2015 ifup-routes*
-rwxr-xr-x. 1 root root 3289 Apr 10 2015 ifup-sit*
-rwxr-xr-x. 1 root root 2563 Apr 10 2015 ifup-tunnel*
-rwxr-xr-x. 1 root root 3951 Apr 10 2015 ifup-wireless*
-rwxr-xr-x. 1 root root 4623 Apr 10 2015 init.ipv6-global*
-rwxr-xr-x. 1 root root 1219 Apr 10 2015 net.hotplug*
-rw-r--r--. 1 root root 14644 Apr 10 2015 network-functions
-rw-r--r--. 1 root root 29853 Apr 10 2015 network-functions-ipv6 

 

Among above, ifcfg-eth0 and ifcfg-eth1 is wired network, and below is the reference example:

DEVICE=eth0
HWADDR=00:E0:4C:68:00:67
TYPE=Ethernet
UUID=c648a3e3-406d-4144-8f5c-4ba7187cf63a
ONBOOT=yes
NM_CONTROLLED=yes
#BOOTPROTO=dhcp
IPADDR=192.168.10.9
NETMASK=255.255.255.0

 

If you haven't set DNS configuration, you should add DNS at /etc/resolv.conf as following:

nameserver 168.126.63.1
nameserver 168.126.63.2
nameserver 8.8.8.8
nameserver 8.8.4.4
Tags Centos DNS ifcfg-eth0 ifcfg-eth1 ifconfig network-scripts resolv.conf sysconfig Facebook X
Comments 0
Similar posts
  1. Setup Apache+PHP+MySQL on Centos 6.7
    605
  2. Adding new cron job for automated processing on every 10 minutes on Centos 6.7
    1,331
  3. mcrypt missing when using phpMyAdmin on Centos 6.7
    550
  4. Set timezone and time on Centos 6.7
    541
  5. How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8)
    913
  6. How to optimize MySQL automatically in CentOS Linux
    1,008
  7. Public DNS (Domain Name Service) based on IPv4, IPv6 widely used
    1,244
  8. Dynamic DNS Made Easy: Building a Python-Based Solution
    795
  9. Building a Basic DNS Server in PHP/Python: A Beginner's Guide
    739
  10. Generate Let’s Encrypt Wildcard SSL Certificate
    626
  11. Upgrading to GCC 4.9.4 in CentOS 7 requires installing a newer version manually
    583
  1. Why SPF and DKIM Are Essential for Linux Email Servers?
    36
  2. Force no caching in Apache by modifying the .htaccess file using appropriate headers
    2,676
  3. Beyond your conventional memory size with swap file instead of a partition
    1,143
  4. Gmail requires all senders to authenticate with either SPF or DKIM.
    681
  5. Bash script to install postfix and sasl for sending email
    1,197
  6. Guide for tmux shortcuts - split current pane, toggle pane
    1,304
  7. Tistory remote blogging example based in CLI & PHP
    2,725
  8. Preventing Unauthorized Image Crawling by Bots: A Clever Discovery and How to Address It
    1,728
  9. Network diagnostic tool for IPv4/IPv6 - traceroute/traceroute6
    1,918
  10. chmod by type (directory and file permission)
    734
  11. Check network port is open or not on CentOS 7
    1,189
  12. Change MySQL port number for security purpose
    815
  13. CentOS warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory on CentOS 7
    1,073
  14. Set up an SMTP server on CentOS 7
    727
  15. File conversion to UTF in Schell Script
    1,024
  16. Server status checking by Shell Script
    1,516
  17. How can I increase MySQL max connections?
    461
Recently updated
  1. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    42
  2. How do I create animated background for Google Meet?
    20,975
  3. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    251
  4. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    94
  5. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    157
  6. Array of arguments passed to script in PHP
    90
  7. Invalid Auction Storms in Ad Tech
    98
  8. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    202
  9. The Two Clocks of Ad Server Architecture
    70
  10. Frequency Cap Architecture Overview
    515
  11. Collecting Proof-of-Play from 100,000 Screens
    146
  12. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    288
  13. What is RedisVL?
    109
  14. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    231
  15. TPU & GPU Cluster Management Tools
    245
  16. The Concept of Scaffolding in AI Agents
    234
  17. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    583
  18. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    259
  19. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    339
  20. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    202
  21. Machine Learning: Training vs. Ranking
    222
  22. The Continuous Learning Machine: Designing a Loop That Actually Turns
    222
  23. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    195
  24. Designing a Data Curation System Around a Vector Database
    221
  25. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    256
  26. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    656
  27. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    196
  28. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    219
  29. Understanding Data Lineage
    262
  30. System Requirements and Architecture: Intelligent Priority-Based Scheduler
    167