A little over 2 months ago, we finished a great series of posts called Basic Commands for Linux Newbies: 2023. Which consisted of 6 useful parts, where we compiled and mentioned very briefly 60 Linux commands and their respective function within the operating system.
And since this previous series was deeply theoretical, in this second series of posts that we will start today, we will begin to see the use of some of these in a more technical and real way. So, in this Part We will start with the following “Linux Commands”: ifconfig, ip and ifup.
But, before starting this post about the practical use of some "Linux Commands", we recommend that you then explore the previous related post with our previous series of articles on these:
Linux Commands – Part 1: ifconfig, ip and ifup
Practical use of Linux commands
ifconfig
The command "Ifconfig" it is used to configure the kernel-resident network interfaces. man page
Examples of using the ifconfig command
- Show details of all interfaces, including disabled interfaces: $ifconfig -a
- Disable the eth0 interface: $ifconfig eth0 down
- Enable eth0 interface: $ifconfig eth0 up
- Assign an IP address to the eth0 interface: $ ifconfig eth0 [ip_address]
To see more usage examples and descriptions of its associated options or parameters, click here.
ip
The command "Ip" It is used to manage (display and manipulate the routes, network devices, interfaces and tunnels within the operating system. man page
Examples of using the ip command
- List of interfaces with detailed information: $ip address
- List of interfaces with brief information from the network layer: $ ip-brief address
- List of interfaces with brief link layer information: $ip -brief link
- Show the routing table: $ip route
- show neighbors (ARP table): $ip neighbor
- Make an interface up/down: $ ip link set [interface] up/down
- Add/Remove an IP address to an interface: $ ip addr add /del [ip]/[mask] dev [interface]
- Add a default route: $ ip route add default via [ip] dev [interface]
To see more usage examples and descriptions of its associated options or parameters, click here.
Ifup
The command "ifup" to manage (enable with ifup or disable with ifdown) the network interfaces of a GNU/Linux operating system. man page
Examples of using the ifup command
- Enable eth0 interface: $ifup[eth0]
- Enable all interfaces defined with "auto" in "/etc/network/interfaces": $ifup -a
- Disable eth0 interface: $ifdown[eth0]
- Disable all interfaces defined with "auto" in "/etc/network/interfaces": $ifdown -a
To see more usage examples and descriptions of its associated options or parameters, click here y here.
Summary
In short, we hope that this first and subsequent posts on the use practical and real of the "Linux Command» continue to contribute so that many people go from being simple users of Operating Systems and their graphic applications, to users of power over the deepest parts of it through the use of the powerful Linux Terminal. And if you have used the terminal before and handled the ifconfig, ip, and ifup commands and you want to contribute something about these, we invite you to do so via comments.
Finally, remember to share this useful information with others, in addition to visiting the home of our «site» to learn more current content, and join our official channel of Telegram to explore more news, tutorials and Linux updates. West group, for more information on today's topic.