With iproute2 all of your previous commands (ifconfig, route etc) are contained within a single command called ip.
The ifconfig command is replaced with ip link and ip addr. To mark an interface down you simply ip link set eth0 down. To mark it up, simply ip link set eth0 up. To add an ip address to the interface you would use ip addr add 10.1.2.3/24 broadcast 10.1.2.255 dev eth0. As you can see you no longer have to enter a netmask, you can use slash notation.
Slash notation Table
slash����netmask
/24������255.255.255.0
/25������255.255.255.128
/26������255.255.255.192
/27������255.255.255.224
/28������255.255.255.240
/29������255.255.255.248
/30������255.255.255.252
/32������255.255.255.255
You do not need to use aliased interfaces (eg. eth0:1) anymore, you can simply use multiple ip addr add commands to add more addresses. To see address, simply type ip addr, and to see links type ip link.
To add routes you use ip route add, so to route 10.1.2.0/24 via 10.2.3.1, you would use ip route add 10.1.2.0/24 via 10.2.3.1 dev eth0. You can set the default gateway using ip route add default via 10.2.3.254 dev eth0.
One of the coolest features with iproute2, is that you can define rules and multiple routing tables. Lets say you have two networks connected to a linux router, you have 10.1.2.1 defined as the default gateway via eth0, but you know that 192.168.2.0/24 has a faster route via eth1. In /etc/iproute2/rt_tables, you would add an entry like 200 nettwo to create the new routing table. You can use the ip rule command to tell the kernel to use a different routing table for traffic to/from the 192.168.2.0/24 network. Lets say the ip on eth1 is 10.1.3.2 and the gw for that network is 10.1.3.1. You would add ip rule add from 192.168.2.0/24 table nettwo, and ip rule add to 192.168.2.0/24 table nettwo. Then ip route add default via 10.1.3.1 dev eth1 table nettwo, this sets the default gw for the new table nettwo. Now traffic through that linux router, will send everything for 192.168.2.0/24 through 10.1.3.1 via eth1 rather than down the default gw on eth0.
You can use ip rule for more advanced features as well such as setting ToS (type of service), and using it to do nat (without needing iptables). For further information see the Advanced Routing Howto on the mirror.


