Can't ifdown eth0 (main interface)
Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
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
add a comment |
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
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
debian networking
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
add a comment |
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
add a comment |
6 Answers
6
active
oldest
votes
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 usingifconfig
will still be recorded as up. To fix
this you can use the--force
option to forceifup
orifdown
to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.
7
To add to this answer, I had to addeth0=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 asauto
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 outifup
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
add a comment |
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.
A cracking answer, but Marco has found the problem. I did trysudo 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 thatifdown
might do.
– Gilles
Oct 11 '12 at 23:12
I don't mean to suggest that you useifconfig
all the time, avoidingifup/down
. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of usingifconfig
instead ofifup/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
add a comment |
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
This is exactly what happened to me. I forgot to append it toauto
. Thanks.
– Mike
Feb 9 '15 at 19:19
add a comment |
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.
add a comment |
Add eth0=eth0
to /run/network/ifstate
. This worked for me
add a comment |
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 usingifconfig
will still be recorded as up. To fix
this you can use the--force
option to forceifup
orifdown
to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.
7
To add to this answer, I had to addeth0=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 asauto
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 outifup
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
add a comment |
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 usingifconfig
will still be recorded as up. To fix
this you can use the--force
option to forceifup
orifdown
to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.
7
To add to this answer, I had to addeth0=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 asauto
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 outifup
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
add a comment |
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 usingifconfig
will still be recorded as up. To fix
this you can use the--force
option to forceifup
orifdown
to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.
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 usingifconfig
will still be recorded as up. To fix
this you can use the--force
option to forceifup
orifdown
to
run configuration or deconfiguration commands despite what it
considers the current state of the interface to be.
answered Oct 11 '12 at 16:46
MarcoMarco
25.3k783119
25.3k783119
7
To add to this answer, I had to addeth0=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 asauto
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 outifup
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
add a comment |
7
To add to this answer, I had to addeth0=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 asauto
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 outifup
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
add a comment |
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.
A cracking answer, but Marco has found the problem. I did trysudo 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 thatifdown
might do.
– Gilles
Oct 11 '12 at 23:12
I don't mean to suggest that you useifconfig
all the time, avoidingifup/down
. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of usingifconfig
instead ofifup/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
add a comment |
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.
A cracking answer, but Marco has found the problem. I did trysudo 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 thatifdown
might do.
– Gilles
Oct 11 '12 at 23:12
I don't mean to suggest that you useifconfig
all the time, avoidingifup/down
. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of usingifconfig
instead ofifup/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
add a comment |
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.
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.
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 trysudo 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 thatifdown
might do.
– Gilles
Oct 11 '12 at 23:12
I don't mean to suggest that you useifconfig
all the time, avoidingifup/down
. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of usingifconfig
instead ofifup/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
add a comment |
A cracking answer, but Marco has found the problem. I did trysudo 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 thatifdown
might do.
– Gilles
Oct 11 '12 at 23:12
I don't mean to suggest that you useifconfig
all the time, avoidingifup/down
. I suggested it only as a troubleshooting step. As I understand the problem, it turned out to be a result of usingifconfig
instead ofifup/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
add a comment |
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
This is exactly what happened to me. I forgot to append it toauto
. Thanks.
– Mike
Feb 9 '15 at 19:19
add a comment |
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
This is exactly what happened to me. I forgot to append it toauto
. Thanks.
– Mike
Feb 9 '15 at 19:19
add a comment |
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
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
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 toauto
. Thanks.
– Mike
Feb 9 '15 at 19:19
add a comment |
This is exactly what happened to me. I forgot to append it toauto
. 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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 5 '18 at 11:13
user9885365user9885365
211
211
add a comment |
add a comment |
Add eth0=eth0
to /run/network/ifstate
. This worked for me
add a comment |
Add eth0=eth0
to /run/network/ifstate
. This worked for me
add a comment |
Add eth0=eth0
to /run/network/ifstate
. This worked for me
Add eth0=eth0
to /run/network/ifstate
. This worked for me
answered Mar 13 '17 at 18:12
JeroenJeroen
1
1
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Mar 27 '18 at 10:36
alpha
1,265417
1,265417
answered Mar 27 '18 at 9:31
Hunter LoweHunter Lowe
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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