Network Basics – The ip Command
Evenly Distributed
Administrators are often faced with the task of implementing load balancing in a scenario such as the configuration shown in Figure 5. In this case, the goal is to spread the network traffic evenly across the two lines. Instead of installing complex software, you just need to call ip
. To support load balancing, the kernel needs to be multipath routing capable – you can check this using the variables CONFIG_IP_ROUTE_MULTIPATH
, which must be set in the kernel configuration.
The command from the first line in Listing 6 is all it takes to set up load balancing. If the system works with dynamically assigned IP addresses that you do not know at the time you call ip
, the command also accepts the specification of the network devices instead of the addresses (second line). The additional weight
parameter assigns weighting to the routes. The system always selects the route with the highest weight.
Listing 6
Configuring Routes
Know-How for Admins
Even if you rarely have to build a complicated network structure at home, basic knowledge of the ip
command helps in many situations – such as when the X server goes on strike and you need to configure network access manually. You'll find several how-tos online describing how to use the ip
command, including the IP Command Reference [3] or the Linux Advanced Routing & Traffic Control HOWTO [4].
Advanced users or network professionals can also use the tc
("traffic control") command contained in the iproute2 package to prioritize network traffic (keyword Quality of Service or QoS for short). QoS means that you can guarantee access to a specific service (HTTP, for example) in situations where other services would otherwise use up all your bandwidth.
Infos
- iproute2: https://web.archive.org/web/20140623231840/http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
- net-tools: https://github.com/giftnuss/net-tools
- IP Command Reference: http://linux-ip.net/gl/ip-cref
- Linux Advanced Routing & Traffic Control HOWTO: https://lartc.org/howto
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Find SysAdmin Jobs
News
-
Kubuntu Focus Announces XE Gen 2 Linux Laptop
Another Kubuntu-based laptop has arrived to be your next ultra-portable powerhouse with a Linux heart.
-
MNT Seeks Financial Backing for New Seven-Inch Linux Laptop
MNT Pocket Reform is a tiny laptop that is modular, upgradable, recyclable, reusable, and ships with Debian Linux.
-
Ubuntu Flatpak Remix Adds Flatpak Support Preinstalled
If you're looking for a version of Ubuntu that includes Flatpak support out of the box, there's one clear option.
-
Gnome 44 Release Candidate Now Available
The Gnome 44 release candidate has officially arrived and adds a few changes into the mix.
-
Flathub Vying to Become the Standard Linux App Store
If the Flathub team has any say in the matter, their product will become the default tool for installing Linux apps in 2023.
-
Debian 12 to Ship with KDE Plasma 5.27
The Debian development team has shifted to the latest version of KDE for their testing branch.
-
Planet Computers Launches ARM-based Linux Desktop PCs
The firm that originally released a line of mobile keyboards has taken a different direction and has developed a new line of out-of-the-box mini Linux desktop computers.
-
Ubuntu No Longer Shipping with Flatpak
In a move that probably won’t come as a shock to many, Ubuntu and all of its official spins will no longer ship with Flatpak installed.
-
openSUSE Leap 15.5 Beta Now Available
The final version of the Leap 15 series of openSUSE is available for beta testing and offers only new software versions.
-
Linux Kernel 6.2 Released with New Hardware Support
Find out what's new in the most recent release from Linus Torvalds and the Linux kernel team.