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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News