Configuring IP Address on Centos 6.7

CK1820 
Created at Nov 08, 2015 13:21:50 
128   0   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 Share on Facebook Share on X

◀ PREVIOUS
Adding new cron job for automated processing on every 10 minutes on Centos 6.7
▶ NEXT
How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8)
  Comments 0
Login for comment
SIMILAR POSTS

Setup Apache+PHP+MySQL on Centos 6.7 (updated at Dec 17, 2023)

Adding new cron job for automated processing on every 10 minutes on Centos 6.7 (updated at Dec 17, 2023)

mcrypt missing when using phpMyAdmin on Centos 6.7 (updated at Jan 15, 2024)

Set timezone and time on Centos 6.7 (created at Nov 02, 2015)

How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8) (updated at Dec 17, 2023)

How to optimize MySQL automatically in CentOS Linux (updated at Dec 17, 2023)

All Engineering Software Development How can you prioritize software design trade-offs when developing a new product? (created at Feb 21, 2024)

Public DNS (Domain Name Service) based on IPv4, IPv6 widely used (updated at Feb 23, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

OTHER POSTS IN THE SAME CATEGORY

Network diagnostic tool for IPv4/IPv6 - traceroute/traceroute6 (created at Mar 06, 2024)

chmod by type (directory and file permission) (created at Jan 15, 2024)

Check network port is open or not on CentOS 7 (updated at Jan 15, 2024)

Change MySQL port number for security purpose (updated at Jan 15, 2024)

CentOS warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory on CentOS 7 (updated at Jan 15, 2024)

Set up an SMTP server on CentOS 7 (created at Jan 15, 2024)

How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8) (updated at Dec 17, 2023)

Adding new cron job for automated processing on every 10 minutes on Centos 6.7 (updated at Dec 17, 2023)

Set timezone and time on Centos 6.7 (created at Nov 02, 2015)

How to optimize MySQL automatically in CentOS Linux (updated at Dec 17, 2023)

How can I increase MySQL max connections? (created at Mar 18, 2008)

UPDATES

Creating a Pinterest-Style Card Layout with Bootstrap and Masonry (created at Apr 24, 2024)

Mastering Excel Data Importation in PHP (updated at Apr 24, 2024)

JSON format control in PHP (updated at Apr 24, 2024)

Equal Height Blocks in Bootstrap with JavaScript (created at Apr 22, 2024)

How to convert integer to text string ? (updated at Apr 22, 2024)

Checking similarity between two strings in PHP (updated at Apr 21, 2024)

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file (updated at Apr 21, 2024)

How do I determine the client IP type (IPv4/IPv6) in PHP (updated at Apr 16, 2024)

How do I determine the client IP type in Python - IPv4 or IPv6 (updated at Apr 13, 2024)

Getting Started with PyTorch: A Beginner's Guide to Building Your First Neural Network (updated at Apr 09, 2024)

Predicting Buyer Preferences with PyTorch: A Deep Learning Approach (updated at Apr 09, 2024)

Forecasting the Weather with PyTorch: A Beginner's Guide to Temperature Prediction (created at Apr 09, 2024)

PyTorch example to Forcast Stock Price based on 10 days Dataset (created at Apr 09, 2024)

Mastering Model Persistence: Saving and Loading Trained Machine Learning Models in Python (created at Apr 08, 2024)

Harnessing the Power of Random Forest Algorithm in Python (created at Apr 08, 2024)

Understanding and Implementing K-Nearest Neighbors (KNN) Algorithm in Python (created at Apr 08, 2024)

Forecasting with Linear Regression and KNN Regression in Python (updated at Apr 07, 2024)

What is 302 Found Redirection in HTTP 1.1? (created at Apr 04, 2024)

Mastering Random Forest Regression: A Comprehensive Guide with Python Examples (updated at Apr 01, 2024)

Python Implementation of Linear Regression (updated at Apr 01, 2024)

Mastering Supervised Machine Learning with Python: A Comprehensive Guide (created at Apr 01, 2024)

Mastering AI: A Beginner's Guide to Python Programming and Beyond (created at Apr 01, 2024)

How do I create animated background for Google Meet? (updated at Mar 28, 2024)

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

How to force cookies, disable php sessid in URL ? (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in Python: Handling A, AAAA, CNAME, and TXT Records (created at Mar 16, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Exploring the Depths of Data Transfer: sendfile vs. kTLS (created at Mar 15, 2024)