0

my /etc/sysconfig/network-scripts/ifcfg-eth0 is like this: /etc/sysconfig/network-scripst/ifcfg-eth0

And I have issued the command "systemctl restart network". But when I issued "ifconfig", it shows that the ip on eth0 is 192.168.1.117,but I configured it as static ip 192.168.1.210 Then I issued "ip addr" , I did got ip 192.168.1.210, but the ip 192.168.1.117 also appeared, which I don't want to have at all: results as "ifconfig" and "ip addr"

How can I handle it?

  • what happens if you do ifdown eth0; ifup eth0; ip addr ? – Serge Jul 4 '16 at 5:40
  • when I issued "ifdown eth0",it shows that " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times. – Julian20151006 Jul 4 '16 at 5:49
  • and when I issued "ifup eth0", it shows " Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0' " for 4 times ,too – Julian20151006 Jul 4 '16 at 5:50
  • Then check if the file exist and its permissions first. – Serge Jul 4 '16 at 5:51
  • then I issued " ip addr ", it shows that "inet 192.168.1.117/24" and "192.168.1.210/24" and "inet6 fe80::20c:29ff:fee6:d6f3/64" are all under eth0 – Julian20151006 Jul 4 '16 at 5:52
1

In the /etc/sysconfig/network-scripts/ifcfg-eth0change BOOTPROTO to none instead of static then restart network using systemctl restart network

BOOTPROTO doesn't support static, it should be either none, bootp or dhcp

https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html

0

This is due to NetworkManager service probably being still in use (on CentOS 7).

You need to either disable entirely NetworkManager (recommended on servers) :

systemctl disable NetworkManager && systemctl stop NetworkManager && service network restart && chkconfig network on

or disable NetworkManager being active on this interface (recommended for desktop), by adding

NM_CONTROLLED=no 

to your ifcfg-eth0 file.

  • yeah, your answer is like @Rahul's answers. Thank you! – Julian20151006 Jul 5 '16 at 5:14
0

Be aware to specify your GATEWAY correctly, maybe you entered the Subnet IP address. You need to add a gateway IP that is usually one number higher than it. So check your IP with an online calculator tool (e.g. this one) and find the correct gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.