Why can't I configure a static IP on my CentOS7 system?












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?










share|improve this question






















  • 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
















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?










share|improve this question






















  • 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














0












0








0


1





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?










share|improve this question













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?







centos ip






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 4 '16 at 5:34









Julian20151006

615




615












  • 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


















  • 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
















what happens if you do ifdown eth0; ifup eth0; ip addr ?
– Serge
Jul 4 '16 at 5:40




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




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




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 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




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










3 Answers
3






active

oldest

votes


















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






share|improve this answer





























    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.






    share|improve this answer























    • 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.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f293689%2fwhy-cant-i-configure-a-static-ip-on-my-centos7-system%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      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






      share|improve this answer


























        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






        share|improve this answer
























          1












          1








          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






          share|improve this answer












          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 4 '16 at 5:50









          SomeGuy

          212112




          212112

























              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.






              share|improve this answer























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
















              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.






              share|improve this answer























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














              0












              0








              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.






              share|improve this answer














              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.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 4 '16 at 13:37









              dr01

              15.9k114970




              15.9k114970










              answered Jul 4 '16 at 13:09









              Bruno Mairlot

              29623




              29623












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


















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
















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




              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.






              share|improve this answer




























                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.






                share|improve this answer


























                  0












                  0








                  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.






                  share|improve this answer














                  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.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 18 at 10:49









                  Glorfindel

                  2151310




                  2151310










                  answered Dec 18 at 10:22









                  Amin

                  11




                  11






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f293689%2fwhy-cant-i-configure-a-static-ip-on-my-centos7-system%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Morgemoulin

                      Scott Moir

                      Souastre