What's the difference between `ifconfig`, `interfaces`, `ifup` and `ifdown`?
Solution 1
In all the desktop editions of Ubuntu, networking is managed not by manual methods; that is, /etc/network/interfaces
, but by Network Manager. Any interface, eth0 or wlan0 for example, that provides networking is, by default, managed by Network Manager.
The mostly deprecated commands ifup and ifdown control interfaces that are listed in /etc/network/interfaces
. In the case you describe, the usual default configuration, only lo the loopback interface is listed and may be started and stopped with ifup/ifdown, although I consider this inadvisable. Usually, the system does this automatically so that no user intervention is required or expected.
In a server, with no graphical desktop, Network Manager isn't installed and so all interfaces are controlled in /etc/network/interfaces
. In such cases, the configuration of the file, auto eth0
, for example, means that the interface starts on boot. Again, typically no user intervention is required or expected. Here is a sample server configuration: How to connect to the internet
Solution 2
/etc/network/interfaces
is a configuration file to be manually edited (the mention of loopback (or lo
) is from the default file that the installer sets up). You won't see any other interfaces unless you added them there. If you haven't defined interfaces here but they're up and configured, then either some other service, such as Network Manager, Wicd, etc. is handling them, or you have manually configured them using the ifconfig
or ip
commands.
ifconfig
, ifup
and ifdown
are all commands for manipulation of interfaces. The latter two have specific functions (as can be seen from their names). ifconfig
(long since deprecated, but still commonly used) and ip
can be used to configure devices (assign IPs, bring them up or down, etc.).
Related videos on Youtube
eldosoa
Updated on September 18, 2022Comments
-
eldosoa almost 2 years
I'm somewhat new to network interfaces and I'm confused with the difference between the 4 terms. I've seen the related question here: What is the difference between Network Manager and 'ifconfig' 'ifup', etc?, but this discusses the difference between all of the above and NetworkManager. I'm looking for something more specific between the 4 terms above.
I know that
interfaces
refers to the file at/etc/network/interfaces
but all I see there is thelo
interface. I would assume that I would seewlan0
andeth0
over there as well, as when I callifconfig
. I also know that thelo
interfaces is activated byifup -a
at boot time.Looking forward to your explanations.
-
eldosoa over 9 years@the_Seppi, thanks but I'm looking for something unrelated to NetworkManager. I'm still confused as to where
wlan0
andeth0
are configured since they're not in the/etc/network/interfaces
file
-
-
muru over 9 yearsNetwork Manager doesn't need a GUI to run.
-
chili555 over 9 years@muru Noted. Edited.