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
-
Escuelas Linux 8.0 is Now Available
Just in time for its 25th anniversary, the developers of Escuelas Linux have released the latest version.
-
LibreOffice 7.5 has Arrived Loaded with New Features and Improvements
The favorite office suite of the Linux community has a new release that includes some visual refreshing and new features across all modules.
-
The Next Major Release of Elementary OS Has Arrived
It's been over a year since the developers of elementary OS released version 6.1 (Jólnir) but they've finally made their latest release (Horus) available with a renewed focus on the user.
-
KDE Plasma 5.27 Beta Is Ready for Testing
The latest beta iteration of the KDE Plasma desktop is now available and includes some important additions and fixes.
-
Netrunner OS 23 Is Now Available
The latest version of this Linux distribution is now based on Debian Bullseye and is ready for installation and finally hits the KDE 5.20 branch of the desktop.
-
New Linux Distribution Built for Gamers
With a Gnome desktop that offers different layouts and a custom kernel, PikaOS is a great option for gamers of all types.
-
System76 Beefs Up Popular Pangolin Laptop
The darling of open-source-powered laptops and desktops will soon drop a new AMD Ryzen 7-powered version of their popular Pangolin laptop.
-
Nobara Project Is a Modified Version of Fedora with User-Friendly Fixes
If you're looking for a version of Fedora that includes third-party and proprietary packages, look no further than the Nobara Project.
-
Gnome 44 Now Has a Release Date
Gnome 44 will be officially released on March 22, 2023.
-
Nitrux 2.6 Available with Kernel 6.1 and a Major Change
The developers of Nitrux have officially released version 2.6 of their Linux distribution with plenty of new features to excite users.