DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

IP Address changed to local after restarting the network services in Linux

March 23, 2018 DbAppWeb Admin

Problem

I have installed the RHEL 6.8 on a server and after assigning the IP address to the system when I restarted the network services IP address changed to local IP.

[root@dbappweb ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
[root@dbappweb ~]#

Checking the IP details which is showing only the loopback address.

[root@dbappweb ~]# ifconfig
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:914598 errors:0 dropped:0 overruns:0 frame:0
          TX packets:914598 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:75014763 (71.5 MiB)  TX bytes:75014763 (71.5 MiB)

Reason

The IP address of the system reset to the local because while configuring the IP address on the ethernet card I have selected the value ‘no’ for On boot.

Solution

Use any method of the methods given below:

Change through the command line

  • Edit the network configuration file and change the value of the parameter ONBOOT from ‘no’ to ‘yes‘
    [root@dbappweb ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    HWADDR=b4:b5:2f:55:ce:a8
    TYPE=Ethernet
    UUID=e2f7b63b-a106-4173-ba85-3b931c9a6718
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=none
    IPADDR=10.20.1.22
    NETMASK=255.255.255.0
    GATEWAY=10.20.1.1
    USERCTL=no
    PEERDNS=yes
    IPV6INIT=no
  • Restart the network services and check the IP details
    [root@dbappweb ~]# service network restart
    Shutting down interface eth0:                              [  OK  ]
    Shutting down loopback interface:                          [  OK  ]
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface eth0:  Determining if ip address 10.20.1.22 is already in use for device eth0...
    [root@dbappweb ~]#
    [root@dbappweb ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr B4:B5:2F:55:CE:A8
              inet addr:10.20.1.22  Bcast:10.20.1.255  Mask:255.255.255.0
              inet6 addr: fe80::b6b5:2fff:fe55:cea8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:5690194 errors:0 dropped:0 overruns:0 frame:0
              TX packets:472539 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1016205668 (969.1 MiB)  TX bytes:233489969 (222.6 MiB)
    
    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:914598 errors:0 dropped:0 overruns:0 frame:0
              TX packets:914598 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:75014763 (71.5 MiB)  TX bytes:75014763 (71.5 MiB)

Change through the graphical interface

  • Run the setup command to launch the graphical interface for the network cards on the system.
  • You can see the On boot is not selected for the eth0 in the network configuration.

    01 IP Address changed to lacal after restarting the network services in Linux

    01 IP Address changed to local after restarting the network services in Linux

  • Select the On boot option for the eth0 in the network configuration and save the network configuration.

    02 IP Address changed to lacal after restarting the network services in Linux

    02 IP Address changed to local after restarting the network services in Linux

  • Now restart the network service and check the IP details
    [root@dbappweb ~]# service network restart
    Shutting down interface eth0:                              [  OK  ]
    Shutting down loopback interface:                          [  OK  ]
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface eth0:  Determining if ip address 10.20.1.22 is already in use for device eth0...
    [root@dbappweb ~]#
    [root@dbappweb ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr B4:B5:2F:55:CE:A8
              inet addr:10.20.1.22  Bcast:10.20.1.255  Mask:255.255.255.0
              inet6 addr: fe80::b6b5:2fff:fe55:cea8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:5690194 errors:0 dropped:0 overruns:0 frame:0
              TX packets:472539 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1016205668 (969.1 MiB)  TX bytes:233489969 (222.6 MiB)
    
    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:914598 errors:0 dropped:0 overruns:0 frame:0
              TX packets:914598 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:75014763 (71.5 MiB)  TX bytes:75014763 (71.5 MiB)

Note: I have faced this issue in RHEL 6.8.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Linux Network Admin Network Configuration Networking RHEL 6.8 Sys Admin

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com
 

Loading Comments...