Thursday, May 3, 2012

iproute2 sounds familiar ahh?

As a software developer I use the iproute2 package quite a bit,
as you may know it's a collection of Linux networking utilities.
wait a minute, you are probably asking yourself , isn't it called net-tools????
well it's pretty the same but actually it's the successor of net-tools.
As the Linux kernel developed over the years a replacement was needed, so then came a new stronger boy to the neighbourhood called iproute2 ;-)

iproute2 offers the same level of control over the Linux networks stack as net-tools.
but it adds few cool tricks, such as: configuring advance routing and shaping capabilities.

Now I'll give few basic examples:

  • The `ip a` (a stands for address) command will print the info about the network interfaces, it's the equivalent to ifconfig in the net-tools package. oh by the way you can view only IPv4 or IPv6 info about an interface via: 
    • ip -4 a 
    • ip -6 a
  • For adding new address to a network interface, you can:            
           ip a a <ip address>/<subnet> brd <broadcast address> dev <device name>
  • For Deleting an address which is assigned to a network interface, you should write:
          ip a del  <ip address>/<subnet>  dev<device name>
  • Shutting down interface eth0: 
          ip l s eth0 down    ( l stands for link, s stands for set)
  • For enabling promiscuous mode on ethernet device eth0: 
          ip l s eth0 promisc on
  • Renaming a network interface, can be done by: 
          ip l s eth0 name ethNew

No comments:

Post a Comment

About