In today’s article, we’re going to learn how to bring your network up or down – in the terminal, of course. This will be an article that’s easy enough for a beginner to understand. It’s not very complicated, so it should also be fairly short. If you’re interested in bringing your network up or down in the terminal, read on!
There are times when you may want to bring your network down and then bring it back up. Odds are that you can do this with a GUI, often with a network manager right there in your system tray.
You can also do this in the terminal. This is especially handy if we’re unable to reach a graphical state and need a network connection for things like updating and troubleshooting. We will use the ‘ip’ command for this, which is a pretty robust command. The ‘ip’ command describes itself as:
ip – show / manipulate routing, network devices, interfaces and tunnels
That’s an accurate description and we will indeed be manipulating network interfaces in this article. We will also be showing network interfaces in this article.
If you’d like to get a head start, you can read the man page:
1 | man ip |
That command will show you all the available options for the ‘ip’ command. We’ll just be using a couple of the commands, so it won’t be all that complicated or stressful.
Bring Your Network Up Or Down:
As the title suggests, we’ll be managing our network interfaces from the terminal. This means you’ll need to open your favorite terminal emulator at this point. If you don’t know how to open the terminal, you can do so with your keyboard – just press
With your terminal now open, you should identify your network interfaces. We can do this with the ‘ip’ command, like so:
1 | ip addr |
Or just:
1 | ip a |
Hint: The connected device(s) will be those with the most information output. Like the wireless network interface in the following image:
Now, if the network interface is down and you want to bring it up. The command is quite simple, it’s just:
1 | sudo ip link set dev <interface> up |
So, in my case, the command would look like this:
1 | sudo ip link set dev wlxe4beed0e5f5c up |
If you wanted to bring it down, and mine is already up, the command would look like this:
1 | sudo ip link set dev <interface> down |
With that, you can bring your network up or down as desired, and from the terminal. It’s not very difficult at all.
If you’re using an older distro, you might still be using ‘ifconfig’. If you are, the commands are a little different, and I include these only for completeness’ sake and would look like this:
1 | sudo ifconfig <interface> up |
And, of course, to bring the network interface down:
1 | sudo ifconfig <interface> down |
So, that’s not too dissimilar to the more modern ‘ip’ command and is still worth mentioning. For a while, as ‘ifconfig’ was sunsetted, you could use both commands with the Ubuntu flavors. In current versions of Ubuntu, you only have the ‘ip’ command available unless you install ‘net-tools’ for some reason.
Closure:
And there you have it! You can now bring your network up or down in the terminal, and it’s not even all that difficult. It’s yet another article and yet another skill you can add to your growing toolbox of commands. It’s just a subset of the things you can do with the ‘ip’ command, but it’s one of the more useful things you can do with it. So, there’s that…
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.