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

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Core Technologies

    Prise the back off Linux and find out what really makes it tick.

  • Multicast IP

    We show you the practical side of multicasting, including a sample configuration that uses the free XORP routing protocol suite.

  • Command Line: Network Diagnostic Tools

    Linux has the right tools to track down network errors and open the way for data packets.

  • Cross-Platform VPN Connections

    Linux clients sometimes need a little help to connect to Windows VPN servers.

  • Bridgewall

    Firewalls are typically implemented as routers,but it doesn’t have to be that way. Bridging packet filters have a number of advantages,and you can add them to your network at a later stage without changing the configuration of your network components.

comments powered by Disqus

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