User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

ifup eth0 ifdown eth0 doesn't work anymore?

Mon Nov 13, 2017 10:10 pm

In the latest raspbian os, it seems ifup eth0 doesn't work. Nothing happens. ifup wlan0 too.
it used to bring up or down the interface.

I'm just trying trying to bring up a wlan0 if it goes down. I'm not using GUI on this pi.

Or how are you supposed to properly restart a wireless network if it disconnects for any reason?
Antikythera

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5959
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: ifup eth0 ifdown eth0 doesn't work anymore?

Mon Nov 13, 2017 11:21 pm

ifup/ifdown is a part of ifupdown, which has been replaced with dhcpcd.

What is the problem exactly? If the network goes down, dhcpcd should reconfigure it whenever it becomes available again.

However, if you would like to bring the link down or up manually, you can run 'ip link set dev eth0 down' (or up). You can also restart dhcpcd by running 'sudo systemctl restart dhcpcd', but you shouldn't need to.

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: ifup eth0 ifdown eth0 doesn't work anymore?

Tue Nov 14, 2017 5:05 am

sometimes pi disconnects from wifi for unknown reason. But does not reconnect sometimes.

So, I guess I could write a script to check status. Like if network is down, restart it.

Thanks.

And I mean static IP.
Antikythera

User avatar
DougieLawson
Posts: 36105
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: ifup eth0 ifdown eth0 doesn't work anymore?

Tue Nov 14, 2017 6:29 am

You get a lot of control over WPA Supplicant using the wpa_cli program. That will reconnect WiFi for you.

https://linux.die.net/man/8/wpa_cli
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5959
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: ifup eth0 ifdown eth0 doesn't work anymore?

Tue Nov 14, 2017 10:39 am

Strange. In my experience, wpa_supplicant tries to reconnect after losing the connection.

Return to “General discussion”