Can't ifdown eth0 (main interface)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












48















I can't ifdown an interface on Debian 6.0.5:



user@box:/etc/network$ sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
SIOCADDRT: File exists
Failed to bring up eth0.

user@box:/etc/network$ cat interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.254

auto eth1
iface eth1 inet manual


As requested by marco:



user@box:/etc/network/$ cat /run/network/ifstate 
lo=lo
eth1=eth1









share|improve this question



















  • 4





    What does /run/network/ifstate contain?

    – Marco
    Oct 11 '12 at 16:17











  • I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

    – jwbensley
    Oct 11 '12 at 16:35











  • @Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

    – jwbensley
    Oct 11 '12 at 16:40















48















I can't ifdown an interface on Debian 6.0.5:



user@box:/etc/network$ sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
SIOCADDRT: File exists
Failed to bring up eth0.

user@box:/etc/network$ cat interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.254

auto eth1
iface eth1 inet manual


As requested by marco:



user@box:/etc/network/$ cat /run/network/ifstate 
lo=lo
eth1=eth1









share|improve this question



















  • 4





    What does /run/network/ifstate contain?

    – Marco
    Oct 11 '12 at 16:17











  • I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

    – jwbensley
    Oct 11 '12 at 16:35











  • @Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

    – jwbensley
    Oct 11 '12 at 16:40













48












48








48


13






I can't ifdown an interface on Debian 6.0.5:



user@box:/etc/network$ sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
SIOCADDRT: File exists
Failed to bring up eth0.

user@box:/etc/network$ cat interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.254

auto eth1
iface eth1 inet manual


As requested by marco:



user@box:/etc/network/$ cat /run/network/ifstate 
lo=lo
eth1=eth1









share|improve this question
















I can't ifdown an interface on Debian 6.0.5:



user@box:/etc/network$ sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
SIOCADDRT: File exists
Failed to bring up eth0.

user@box:/etc/network$ cat interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.254

auto eth1
iface eth1 inet manual


As requested by marco:



user@box:/etc/network/$ cat /run/network/ifstate 
lo=lo
eth1=eth1






debian networking






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 15 '18 at 12:36









bcmcfc

1034




1034










asked Oct 11 '12 at 16:02









jwbensleyjwbensley

2,392103041




2,392103041







  • 4





    What does /run/network/ifstate contain?

    – Marco
    Oct 11 '12 at 16:17











  • I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

    – jwbensley
    Oct 11 '12 at 16:35











  • @Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

    – jwbensley
    Oct 11 '12 at 16:40












  • 4





    What does /run/network/ifstate contain?

    – Marco
    Oct 11 '12 at 16:17











  • I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

    – jwbensley
    Oct 11 '12 at 16:35











  • @Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

    – jwbensley
    Oct 11 '12 at 16:40







4




4





What does /run/network/ifstate contain?

– Marco
Oct 11 '12 at 16:17





What does /run/network/ifstate contain?

– Marco
Oct 11 '12 at 16:17













I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

– jwbensley
Oct 11 '12 at 16:35





I have updated my question with the contents of this file, eth0 isn't in there. A quick "Google" is telling me the meaning of this file (as I haven't accessed it before), I think I can see where the problem is :)

– jwbensley
Oct 11 '12 at 16:35













@Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

– jwbensley
Oct 11 '12 at 16:40





@Marco; This has indeed fixed my problem, if you post this as an answer I can mark it as correct :)

– jwbensley
Oct 11 '12 at 16:40










6 Answers
6






active

oldest

votes


















54














Check the contents of the file /run/network/ifstate. ifup and ifdown use this file to note which network interfaces can be brought up and down. Thus, ifup can be easily confused when other networking tools are used to bring up an interface (e.g. ifconfig).



From man ifup




The program keeps records of whether network interfaces are up or
down. Under exceptional circumstances these records can become
inconsistent with the real states of the interfaces. For example,
an interface that was brought up using ifup and later
deconfigured using ifconfig will still be recorded as up. To fix
this you can use the --force option to force ifup or ifdown to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.







share|improve this answer


















  • 7





    To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

    – David Parks
    Apr 4 '13 at 9:15







  • 1





    @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

    – Marco
    Apr 4 '13 at 9:23











  • --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

    – sanmai
    Jun 23 '17 at 4:40



















31














ifdown is a high-level program which does a lot of things you might not need. Additionally, it isn't available everywhere. The more portable way might work for you:



$ sudo ifconfig eth0 down


If you then can't ifup it, you likely have some configuration problem. Manually bringing it up with ifconfig eth0 up probably isn't the right thing in that case. On Debian, ifup is a binary executable, so you'd probably have to strace it to figure out where it's getting hung up:



$ sudo strace -e open ifup eth0


That will tell you which files ifup is opening while it works, which might clue you into the problem.



On other systems (e.g. RHEL and derivatives) ifup is a shell script, so it's a lot easier to debug:



# sh -x `which ifup` eth0


Running a shell script with sh -x makes it print every line it runs, so you can trace the execution.






share|improve this answer

























  • A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

    – jwbensley
    Oct 11 '12 at 16:39











  • Forgot to say, great idea with the -x option! Thanks!

    – jwbensley
    Oct 11 '12 at 16:53






  • 1





    ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

    – Gilles
    Oct 11 '12 at 23:12











  • I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

    – Warren Young
    Oct 12 '12 at 0:02


















20














I've seen this before when ethX wasn't properly configured in
/etc/network/interfaces. This needs something like:-



auto eth0
iface eth0 inet dhcp


Even with an improperly configured /etc/network/interfaces file, you can still bring down eth0 with:



$ sudo ip link set eth0 down





share|improve this answer

























  • This is exactly what happened to me. I forgot to append it to auto. Thanks.

    – Mike
    Feb 9 '15 at 19:19


















2














For anyone struggling with this problem:



I checked the file ifstate."interface-name" at /run/network.



It was empty so I included "interface-name"(eth0) into ifstate."interface-name" file at /run/network.






share|improve this answer






























    0














    Add eth0=eth0 to /run/network/ifstate. This worked for me






    share|improve this answer






























      0














      What I found helped me is to call the rm command to remove the lock file within /run/network/



      Do ls -la and you should see a hidden .ifstate file or something under that name.



      Remove that and then try: ifdown && ifup



      If you're worried you might break something just make a copy of that file outside the directory and remove the one inside the directory.






      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%2f50602%2fcant-ifdown-eth0-main-interface%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        54














        Check the contents of the file /run/network/ifstate. ifup and ifdown use this file to note which network interfaces can be brought up and down. Thus, ifup can be easily confused when other networking tools are used to bring up an interface (e.g. ifconfig).



        From man ifup




        The program keeps records of whether network interfaces are up or
        down. Under exceptional circumstances these records can become
        inconsistent with the real states of the interfaces. For example,
        an interface that was brought up using ifup and later
        deconfigured using ifconfig will still be recorded as up. To fix
        this you can use the --force option to force ifup or ifdown to
        run configuration or deconfiguration commands despite what it
        considers the current state of the interface to be.







        share|improve this answer


















        • 7





          To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

          – David Parks
          Apr 4 '13 at 9:15







        • 1





          @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

          – Marco
          Apr 4 '13 at 9:23











        • --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

          – sanmai
          Jun 23 '17 at 4:40
















        54














        Check the contents of the file /run/network/ifstate. ifup and ifdown use this file to note which network interfaces can be brought up and down. Thus, ifup can be easily confused when other networking tools are used to bring up an interface (e.g. ifconfig).



        From man ifup




        The program keeps records of whether network interfaces are up or
        down. Under exceptional circumstances these records can become
        inconsistent with the real states of the interfaces. For example,
        an interface that was brought up using ifup and later
        deconfigured using ifconfig will still be recorded as up. To fix
        this you can use the --force option to force ifup or ifdown to
        run configuration or deconfiguration commands despite what it
        considers the current state of the interface to be.







        share|improve this answer


















        • 7





          To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

          – David Parks
          Apr 4 '13 at 9:15







        • 1





          @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

          – Marco
          Apr 4 '13 at 9:23











        • --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

          – sanmai
          Jun 23 '17 at 4:40














        54












        54








        54







        Check the contents of the file /run/network/ifstate. ifup and ifdown use this file to note which network interfaces can be brought up and down. Thus, ifup can be easily confused when other networking tools are used to bring up an interface (e.g. ifconfig).



        From man ifup




        The program keeps records of whether network interfaces are up or
        down. Under exceptional circumstances these records can become
        inconsistent with the real states of the interfaces. For example,
        an interface that was brought up using ifup and later
        deconfigured using ifconfig will still be recorded as up. To fix
        this you can use the --force option to force ifup or ifdown to
        run configuration or deconfiguration commands despite what it
        considers the current state of the interface to be.







        share|improve this answer













        Check the contents of the file /run/network/ifstate. ifup and ifdown use this file to note which network interfaces can be brought up and down. Thus, ifup can be easily confused when other networking tools are used to bring up an interface (e.g. ifconfig).



        From man ifup




        The program keeps records of whether network interfaces are up or
        down. Under exceptional circumstances these records can become
        inconsistent with the real states of the interfaces. For example,
        an interface that was brought up using ifup and later
        deconfigured using ifconfig will still be recorded as up. To fix
        this you can use the --force option to force ifup or ifdown to
        run configuration or deconfiguration commands despite what it
        considers the current state of the interface to be.








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 11 '12 at 16:46









        MarcoMarco

        25.3k783119




        25.3k783119







        • 7





          To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

          – David Parks
          Apr 4 '13 at 9:15







        • 1





          @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

          – Marco
          Apr 4 '13 at 9:23











        • --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

          – sanmai
          Jun 23 '17 at 4:40













        • 7





          To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

          – David Parks
          Apr 4 '13 at 9:15







        • 1





          @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

          – Marco
          Apr 4 '13 at 9:23











        • --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

          – sanmai
          Jun 23 '17 at 4:40








        7




        7





        To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

        – David Parks
        Apr 4 '13 at 9:15






        To add to this answer, I had to add eth0=eth0 to /run/network/ifstate to get it to recognize the interface and configure it properly. This answer helped point me to the file, but stopped short of suggesting that addition, which is what solved my similar problem.

        – David Parks
        Apr 4 '13 at 9:15





        1




        1





        @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

        – Marco
        Apr 4 '13 at 9:23





        @DavidParks Are you sure the interface is marked as auto in /etc/network/interfaces? It should appear in /run/network/ifstate without the need to manually modify the file.

        – Marco
        Apr 4 '13 at 9:23













        --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

        – sanmai
        Jun 23 '17 at 4:40






        --force was the answer for me; it turned out ifup didn't bring the interface up in the first place because of a failing command in /etc/network/if-pre-up.d; lucky me having network at all!

        – sanmai
        Jun 23 '17 at 4:40














        31














        ifdown is a high-level program which does a lot of things you might not need. Additionally, it isn't available everywhere. The more portable way might work for you:



        $ sudo ifconfig eth0 down


        If you then can't ifup it, you likely have some configuration problem. Manually bringing it up with ifconfig eth0 up probably isn't the right thing in that case. On Debian, ifup is a binary executable, so you'd probably have to strace it to figure out where it's getting hung up:



        $ sudo strace -e open ifup eth0


        That will tell you which files ifup is opening while it works, which might clue you into the problem.



        On other systems (e.g. RHEL and derivatives) ifup is a shell script, so it's a lot easier to debug:



        # sh -x `which ifup` eth0


        Running a shell script with sh -x makes it print every line it runs, so you can trace the execution.






        share|improve this answer

























        • A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

          – jwbensley
          Oct 11 '12 at 16:39











        • Forgot to say, great idea with the -x option! Thanks!

          – jwbensley
          Oct 11 '12 at 16:53






        • 1





          ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

          – Gilles
          Oct 11 '12 at 23:12











        • I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

          – Warren Young
          Oct 12 '12 at 0:02















        31














        ifdown is a high-level program which does a lot of things you might not need. Additionally, it isn't available everywhere. The more portable way might work for you:



        $ sudo ifconfig eth0 down


        If you then can't ifup it, you likely have some configuration problem. Manually bringing it up with ifconfig eth0 up probably isn't the right thing in that case. On Debian, ifup is a binary executable, so you'd probably have to strace it to figure out where it's getting hung up:



        $ sudo strace -e open ifup eth0


        That will tell you which files ifup is opening while it works, which might clue you into the problem.



        On other systems (e.g. RHEL and derivatives) ifup is a shell script, so it's a lot easier to debug:



        # sh -x `which ifup` eth0


        Running a shell script with sh -x makes it print every line it runs, so you can trace the execution.






        share|improve this answer

























        • A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

          – jwbensley
          Oct 11 '12 at 16:39











        • Forgot to say, great idea with the -x option! Thanks!

          – jwbensley
          Oct 11 '12 at 16:53






        • 1





          ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

          – Gilles
          Oct 11 '12 at 23:12











        • I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

          – Warren Young
          Oct 12 '12 at 0:02













        31












        31








        31







        ifdown is a high-level program which does a lot of things you might not need. Additionally, it isn't available everywhere. The more portable way might work for you:



        $ sudo ifconfig eth0 down


        If you then can't ifup it, you likely have some configuration problem. Manually bringing it up with ifconfig eth0 up probably isn't the right thing in that case. On Debian, ifup is a binary executable, so you'd probably have to strace it to figure out where it's getting hung up:



        $ sudo strace -e open ifup eth0


        That will tell you which files ifup is opening while it works, which might clue you into the problem.



        On other systems (e.g. RHEL and derivatives) ifup is a shell script, so it's a lot easier to debug:



        # sh -x `which ifup` eth0


        Running a shell script with sh -x makes it print every line it runs, so you can trace the execution.






        share|improve this answer















        ifdown is a high-level program which does a lot of things you might not need. Additionally, it isn't available everywhere. The more portable way might work for you:



        $ sudo ifconfig eth0 down


        If you then can't ifup it, you likely have some configuration problem. Manually bringing it up with ifconfig eth0 up probably isn't the right thing in that case. On Debian, ifup is a binary executable, so you'd probably have to strace it to figure out where it's getting hung up:



        $ sudo strace -e open ifup eth0


        That will tell you which files ifup is opening while it works, which might clue you into the problem.



        On other systems (e.g. RHEL and derivatives) ifup is a shell script, so it's a lot easier to debug:



        # sh -x `which ifup` eth0


        Running a shell script with sh -x makes it print every line it runs, so you can trace the execution.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 11 '12 at 16:43

























        answered Oct 11 '12 at 16:32









        Warren YoungWarren Young

        55.4k11143148




        55.4k11143148












        • A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

          – jwbensley
          Oct 11 '12 at 16:39











        • Forgot to say, great idea with the -x option! Thanks!

          – jwbensley
          Oct 11 '12 at 16:53






        • 1





          ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

          – Gilles
          Oct 11 '12 at 23:12











        • I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

          – Warren Young
          Oct 12 '12 at 0:02

















        • A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

          – jwbensley
          Oct 11 '12 at 16:39











        • Forgot to say, great idea with the -x option! Thanks!

          – jwbensley
          Oct 11 '12 at 16:53






        • 1





          ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

          – Gilles
          Oct 11 '12 at 23:12











        • I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

          – Warren Young
          Oct 12 '12 at 0:02
















        A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

        – jwbensley
        Oct 11 '12 at 16:39





        A cracking answer, but Marco has found the problem. I did try sudo ifconfig eth0 down && sudo ifconfig eth0 up which would flap the interface up and down but I was trying to manually trigger an if-up script I have been writing and that wasn't doing it. After updating my /etc/network/run/ifstate file, ifdown/up works now. Thanks for your info though! :)

        – jwbensley
        Oct 11 '12 at 16:39













        Forgot to say, great idea with the -x option! Thanks!

        – jwbensley
        Oct 11 '12 at 16:53





        Forgot to say, great idea with the -x option! Thanks!

        – jwbensley
        Oct 11 '12 at 16:53




        1




        1





        ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

        – Gilles
        Oct 11 '12 at 23:12





        ifdown is a high-level program which does a lot of thing that you might need. ifconfig eth0 down is more portable and can always be run, but it doesn't perform the cleanup tasks that ifdown might do.

        – Gilles
        Oct 11 '12 at 23:12













        I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

        – Warren Young
        Oct 12 '12 at 0:02





        I don't mean to suggest that you use ifconfig all the time, avoiding ifup/down. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of using ifconfig instead of ifup/down, thereby confusing the high-level mechanisms. But, I didn't know that when I posted my answer.

        – Warren Young
        Oct 12 '12 at 0:02











        20














        I've seen this before when ethX wasn't properly configured in
        /etc/network/interfaces. This needs something like:-



        auto eth0
        iface eth0 inet dhcp


        Even with an improperly configured /etc/network/interfaces file, you can still bring down eth0 with:



        $ sudo ip link set eth0 down





        share|improve this answer

























        • This is exactly what happened to me. I forgot to append it to auto. Thanks.

          – Mike
          Feb 9 '15 at 19:19















        20














        I've seen this before when ethX wasn't properly configured in
        /etc/network/interfaces. This needs something like:-



        auto eth0
        iface eth0 inet dhcp


        Even with an improperly configured /etc/network/interfaces file, you can still bring down eth0 with:



        $ sudo ip link set eth0 down





        share|improve this answer

























        • This is exactly what happened to me. I forgot to append it to auto. Thanks.

          – Mike
          Feb 9 '15 at 19:19













        20












        20








        20







        I've seen this before when ethX wasn't properly configured in
        /etc/network/interfaces. This needs something like:-



        auto eth0
        iface eth0 inet dhcp


        Even with an improperly configured /etc/network/interfaces file, you can still bring down eth0 with:



        $ sudo ip link set eth0 down





        share|improve this answer















        I've seen this before when ethX wasn't properly configured in
        /etc/network/interfaces. This needs something like:-



        auto eth0
        iface eth0 inet dhcp


        Even with an improperly configured /etc/network/interfaces file, you can still bring down eth0 with:



        $ sudo ip link set eth0 down






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 11 '12 at 18:14

























        answered Oct 11 '12 at 18:08









        Alex LeachAlex Leach

        4,29742426




        4,29742426












        • This is exactly what happened to me. I forgot to append it to auto. Thanks.

          – Mike
          Feb 9 '15 at 19:19

















        • This is exactly what happened to me. I forgot to append it to auto. Thanks.

          – Mike
          Feb 9 '15 at 19:19
















        This is exactly what happened to me. I forgot to append it to auto. Thanks.

        – Mike
        Feb 9 '15 at 19:19





        This is exactly what happened to me. I forgot to append it to auto. Thanks.

        – Mike
        Feb 9 '15 at 19:19











        2














        For anyone struggling with this problem:



        I checked the file ifstate."interface-name" at /run/network.



        It was empty so I included "interface-name"(eth0) into ifstate."interface-name" file at /run/network.






        share|improve this answer



























          2














          For anyone struggling with this problem:



          I checked the file ifstate."interface-name" at /run/network.



          It was empty so I included "interface-name"(eth0) into ifstate."interface-name" file at /run/network.






          share|improve this answer

























            2












            2








            2







            For anyone struggling with this problem:



            I checked the file ifstate."interface-name" at /run/network.



            It was empty so I included "interface-name"(eth0) into ifstate."interface-name" file at /run/network.






            share|improve this answer













            For anyone struggling with this problem:



            I checked the file ifstate."interface-name" at /run/network.



            It was empty so I included "interface-name"(eth0) into ifstate."interface-name" file at /run/network.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 5 '18 at 11:13









            user9885365user9885365

            211




            211





















                0














                Add eth0=eth0 to /run/network/ifstate. This worked for me






                share|improve this answer



























                  0














                  Add eth0=eth0 to /run/network/ifstate. This worked for me






                  share|improve this answer

























                    0












                    0








                    0







                    Add eth0=eth0 to /run/network/ifstate. This worked for me






                    share|improve this answer













                    Add eth0=eth0 to /run/network/ifstate. This worked for me







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 13 '17 at 18:12









                    JeroenJeroen

                    1




                    1





















                        0














                        What I found helped me is to call the rm command to remove the lock file within /run/network/



                        Do ls -la and you should see a hidden .ifstate file or something under that name.



                        Remove that and then try: ifdown && ifup



                        If you're worried you might break something just make a copy of that file outside the directory and remove the one inside the directory.






                        share|improve this answer





























                          0














                          What I found helped me is to call the rm command to remove the lock file within /run/network/



                          Do ls -la and you should see a hidden .ifstate file or something under that name.



                          Remove that and then try: ifdown && ifup



                          If you're worried you might break something just make a copy of that file outside the directory and remove the one inside the directory.






                          share|improve this answer



























                            0












                            0








                            0







                            What I found helped me is to call the rm command to remove the lock file within /run/network/



                            Do ls -la and you should see a hidden .ifstate file or something under that name.



                            Remove that and then try: ifdown && ifup



                            If you're worried you might break something just make a copy of that file outside the directory and remove the one inside the directory.






                            share|improve this answer















                            What I found helped me is to call the rm command to remove the lock file within /run/network/



                            Do ls -la and you should see a hidden .ifstate file or something under that name.



                            Remove that and then try: ifdown && ifup



                            If you're worried you might break something just make a copy of that file outside the directory and remove the one inside the directory.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 27 '18 at 10:36









                            alpha

                            1,265417




                            1,265417










                            answered Mar 27 '18 at 9:31









                            Hunter LoweHunter Lowe

                            1




                            1



























                                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.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f50602%2fcant-ifdown-eth0-main-interface%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

                                How to check contact read email or not when send email to Individual?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay