How To Install Iproute2 Ubuntu
Distributor ID: Ubuntu > Description: Ubuntu 12.04.1 LTS > Release: 12.04 > Codename: precise >. I would like to upgrade iproute 2 to the latest version ( release). > I tried apt-get update, apt-get install iproute-dev but no difference. Hi, I am trying to install iproute2 4.9.0 on Ubuntu 16.04 running kernel 4.9. I have tried sudo apt-get install iproute2, to try and get the latest. IProute2 – Networking and Traffic control tools. Install iproute2 in ubuntu. Open the terminal and run the following command. Sudo apt-get install iproute.
Introduction
It is essential to have an understanding of basic networking tools when administering and troubleshooting Linux servers. While some tools are made primarily for monitoring, other low-level utilities are used to configure the network connection itself and implement default settings.
net-tools
was used to do this. They were often packaged together to provide full functionality coverage, but their development and usage strategy varied from tool to tool.iproute2
has been used to replace these separate tools. They have been developed in tandem to share syntax and operate together efficiently.While the querying commands can usually be executed as an unprivileged user, root privileges must be used to modify settings.
How To View Network Interfaces, Addresses, and Routes
One of the most fundamental responsibilities of the iproute2 suite is to manage actual interfaces.
Usually, the interfaces themselves will be named things like eth0
, eth1
, lo
, etc. Traditionally, the ifconfig
command was used to configure items in this area. Under the iproute2 system, the subcommands ip addr
and ip link
take care of these steps.
Ubuntu How To Install
With ifconfig, you could gather information about the current state of your network interfaces by typing the command with no arguments:
To get information about a single interface, you can always specify it as an argument:
We can replicate this functionality with subcommands in the iproute2 suite.
To get an overview of the addresses attached to each interface, type ip addr
in with no arguments:
To get a specific interface, you can use this syntax:
In fact, the ip addr
command is just an alias for the ip addr show
command.
If you are only concerned with the interfaces themselves and not the addresses, you can use the ip link
command instead:
To get information about a specific interface, you’ll need to add the keyword show
followed by the interface name:
To get statistics about how an interface is communicating, you can query statistics from each interface by passing the -s
option to the link subcommand:
So how do we find our routing table? The routing table contains kernel information about the paths to other network locations. We can print off the current routing table by typing:
This shows us that the default route to the greater internet is available through the eth0
interface and the address 107.170.58.1. We can access this server through that interface, where our own interface address is 107.170.58.162.
How To Configure Network Interfaces and Addresses
Now that you are familiar with how to get information about the interfaces and addresses associated with them, the next step is to find out how to modify their states.
The first step is to configure the interface itself. You can do this with the ip link
subcommand again. This time, however, you pass the action set
instead of show in order to modify values.
For instance, we can bring a network interface up or down by issuing these:
Note: Be careful not to accidentally bring down the interface that you are connected to your server through.
You can also use the ip link
subcommand to set attributes about the interface. For instance, if you would like to change the multicast flag on or off for your interface, you can type:
You can adjust the mtu and package queue length like this:
If the interface you are configuring is down, you can adjust the interface name and the arp flag associated with the device:
To adjust the addresses associated with the interfaces, we again use the ip addr
subcommand.
We can add an address to a device by typing:
The brd +
Download mp3 gratis lagu barat cranberries. portion of the command automatically sets the broadcast address. Multiple addresses can be added to each interface without a problem.
How To Install Ubuntu Desktop
We can get rid of addresses with the inverse operation. To delete a specific address associated with an interface, you can use it like this:
Optionally, you can omit the address, and the first listed address associated with that interface will be deleted.
You can also adjust the routing of the server, using the ip route [add change replace delete ]
syntax, but we won’t be covering this here, because most people will will not be adjusting this on a regular basis.
Additional Capabilities of IPRoute2
IPRoute2 has some additional capabilities that we will not be able to discuss in-depth in this guide. Instead, we will talk about what these are and what situations you may find them useful.
The idea of IP routing rules is difficult to talk about because it is very situation dependent. Watch zee telugu serials online. Basically, you can decide on how to route traffic based on a number of fields, including target address, source address, routing protocol, packet size, etc.
We access this functionality by using the ip rule
subcommand. The basic querying follows the general pattern of the other subcommands:
These three routing rules are the default rules configured by the kernel. The first line matches any traffic and is used to route high priority traffic. The second line is the main rule that handles normal routing. The last one is an empty rule that is used for post-processing if the rules above didn’t match the packet.
Routing rules, as configured by the IPRoute2 software, are stored in a routing policy database, where the policy is selected by matching against sets of rules. We can add or delete rules using the appropriate actions. You should not do this without knowing what you are doing however. Look at the man pages and search for ip rule
for more information.
Another thing that we’ll discuss briefly is the handling of arp information through these tools. The subcommand that deals with this information is called ip neigh
.
By default, this should at least list your gateway. Arp is a protocol used to gather information about physical devices accessible through the local network.
Basically, an arp request is broadcast over the local network whenever an IP address needs to be reached. The matching IP address responds and then the local computer knows where to send information to that IP address. This information is cached on the local system for some time (typically about 15 minutes) to avoid having to query during follow up communication.
Conclusion
You should now have a fairly good idea of how to use the tools included in the iproute2 suite. While many guides and tutorials still refer to the old utilities, partly because knowledgeable system admins often grew up using the older tools, the commands discussed in this guide will be taking over in the coming years.
It is important to familiarize yourself with these commands now before you find yourself troubleshooting issues on a system that has switched to these commands (Arch Linux already fully converted in 2011). In general, they are much more consistent, and you can count on certain conventions being available in all of the commands. The more you use these commands, the more they will become second nature.