- ifconfig and route belong to net-tools and allow you to configure interfaces, IP addresses and routes, but they are considered obsolete in many distributions.
- The iproute2 suite, with the ip command, unifies and extends these functions, managing interfaces, addresses, routes, ARP, QoS, tunnels, and multiple routing tables.
- iproute2 facilitates advanced routing with ip route and ip rule, allowing multiple tables, load balancing between gateways, and source- and destination-based policies.
- The move to iproute2 brings more power and flexibility, although it requires learning a new syntax and adapting legacy scripts based on ifconfig and route.
Properly manage network interfaces and IP routes It's one of those basic tasks that you'll have to take on sooner or later if you manage systems. LinuxFor many years, the commands classical ifconfig y route They have been the perfect toolbox for configuring IPs, raising cards, or defining the gateway.
Today, however, That old set of net-tools utilities is considered obsolete. in many modern distributions, which have replaced it with the suite iproute2 and its star command ipEven so, on older servers, teaching materials, legacy scripts, or courses of hacking y ciberseguridad, you keep finding ifconfig y route everywhere, so understanding how they work (and how they translate to ip) is fundamental.
From ifconfig and route to iproute2 suite

The commands ifconfig y road. They are part of the historical package net-tools, inherited from the world UnixThey have been configured network interfaces, IP addresses, masks, gateways, and static routes for decades, along with other utilities such as arp, netstat, iptunnel, mii-tool o rarp.
With ThereNetworking needs in Linux have become more complex: IPv6, QoS, load balancing, multiple routing tables, tunnels, VLANs VPN, network namespacesThe old net-tools package fell short and was practically frozen in functionality.
To cover all this appeared iproute2, a collection of modern utilities where the centerpiece is the command ipWith this single binary you can perform tasks that previously required combining. ifconfig, route, arp, netstat, iptunnel and company, plus many advanced features that net-tools never dreamed of supporting.
In practice, iproute2 completely replaces net-toolsThat's why distributions like Debian, recent Ubuntu versions, and many systemd-based distributions mark net-tools as "deprecated" and no longer install it by default. Even so, ifconfig and route are still present in many environments, especially formative or legacy ones, so it is advisable to master both worlds.
ifconfig command: basic interface configuration
The command ifconfig (interface configurator) has traditionally been used to View and modify network interface settingsIt allows you to initialize a card, assign it an IP address, activate or deactivate it, change parameters such as MTU or promiscuous mode, etc.
The general syntax of ifconfig It is very simple: ifconfig [opciones] [interfaz] to display information, and ifconfig interfaz [configuración] [up|down] when we want to change parameters or raise/lower the card.
If you run it without arguments, `ifconfig` displays all active interfaces with its IP, mask, broadcast, address MACMTU and traffic statistics:
/sbin/ifconfig
To See also inactive interfaces (for example, a card that exists but is deactivated), the option is added -awhich lists absolutely everything:
ifconfig -a
When you want to focus on a single, concrete interfaceSimply specify its name. For example, to view details of the main Ethernet connection:
ifconfig eth0
On many modern machines the name is no longer eth0but something like ens33, enp0s3 or similarBut the idea is the same: ifconfig It gives you its IP, its MAC, the status (UP, RUNNING, etc.), the subnet mask and other useful information.
Common operations with ifconfig
One of the most frequent tasks with net-tools is activate or deactivate a network interface. With ifconfig It's done like this:
# Levantar (activar) la interfaz
ifconfig ens33 up
# Bajar (desactivar) la interfaz
ifconfig ens33 down
Another classic operation is assign an IPv4 address and its subnet mask. With ifconfig The IP address is indicated, followed by the mask (and optionally broadcast):
# Asignar IP y máscara
ifconfig eth0 193.144.84.77 netmask 255.255.255.0 broadcast 193.144.84.255 up
The command also allows adjust the MTU (Maximum Transmission Unit)That is, the maximum size of the datagram in bytes that can circulate through that interface:
# Cambiar la MTU a 500 bytes
ifconfig eth0 mtu 500
Furthermore, ifconfig can modify interface “flags”, such as enabling promiscuous mode to capture all traffic, disabling ARP, or even changing the MAC address if the device supports it:
# Activar modo promiscuo
ifconfig eth0 promisc
# Desactivar ARP
ifconfig eth0 -arp
# Cambiar la dirección hardware (MAC)
ifconfig eth0 hw ether 52:54:00:12:34:56
Regarding IPv6, ifconfig can also display and handle version 6 protocol addressesAnd by its very nature, IPv6 allows multiple addresses on the same interface without the need for Tricks of aliases, something that net-tools perfectly supports.
IP aliases and other related utilities
A classic feature in old settings is the IP aliasingwhich allows assigning multiple IPv4 addresses to the same card using identifiers of the type dispositivo:número:
# Primera IP en la interfaz
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up
route add -net 192.168.1.0 netmask 255.255.255.0 eth0
# Alias con otra red en la misma tarjeta
ifconfig eth0:0 192.168.10.1 netmask 255.255.255.0 up
route add -net 192.168.10.0 netmask 255.255.255.0 eth0:0
Along with ifconfig, the net-tools ecosystem includes other tools for level 2 and 3 operations, such as ifup/ifdown to activate or deactivate interfaces using the distribution's configuration files, or iwconfig for WiFi networks:
# Desactivar una interfaz según configuración del sistema
ifdown eth0
# Configurar parámetros WiFi
iwconfig eth1 essid "Mi Red"
In modern environments, all of this has been replaced by higher-level utilities such as NetworkManager, Wicked, netplan, ConnMan or WicdMany of them have a graphical interface and are designed for users less accustomed to terminal.
route command: classic routing table management
The other pillar of net-tools is the command road., Manager display and manipulate the kernel's IPv4 routing tableWith it you can list routes, add or remove static routes, and define the default gateway.
To view the routing table in a readable format, the usual practice is to use route -n, which displays unresolved numeric hostname addresses (very useful in network administration):
/sbin/route -n -ee
The flags in each row indicate the type of route: U (active interface), H (host destination), G (use gateway), D (dynamically created), M (dynamically modified), R (rehabilitated) or ! (route rejected).
To add or delete static routes, route uses the syntax:
route [add|del] [default] [-net|-host] target \
[netmask Nm] [gw Gw] [opciones] [[dev] If]
For example, for reach the network 192.168.0.0/24 through eth1:
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth1
And to define the Default Gateway (through which everything that does not go to known networks will exit), it is done like this:
route add default gw 10.0.2.2
If you want a remote network to be accessible using a intermediate walkwayYou also define it with `route`. For example, the network 172.16.0.0/24 through the host 192.168.0.1:
route add -net 172.16.0.0 netmask 255.255.255.0 gw 192.168.0.1
For this last piece of equipment to actually route traffic between interfaces, it is necessary enable IP forwarding in the kernel:
echo 1 > /proc/sys/net/ipv4/ip_forward
Classic network diagnostic tools
In addition to ifconfig and route, the net-tools package and associated utilities provide commonly used diagnostic commands that remain in force, such as netstat, arp, ping, traceroute or mii-tool.
The command netstat allow View active connections, routing tables, interface statistics, and usage by protocol. For example, netstat -i offers a summary similar to ifconfig -s, and netstat -r displays the routing table (equivalent to route with options).
The command arp manipulate the system ARP cache: Shows entries, deletes or adds static recordsA typical list would be:
arp
arp -a hostname
arp -i eth0
arp -d hostname
arp -s hostname hw_addr
To check IP-level connectivity, ping sends ICMP packets ECHO_REQUEST and measures the round trip time. It's important to keep in mind that Many firewalls block ICMPSo, the absence of a response does not always mean that the host is down.
When you want to see where a package "travels" until it reaches its destination, it appears traceroutewhich relies on the TTL field of the IP header and ICMP responses of type TIME_EXCEEDED. There are variants such as tcptraceroute or traceproto, which use other protocols to circumvent certain restrictions.
Finally, for details on the physical layer and link negotiation, mii-tool o ethtool They allow you to view and adjust speed, duplex mode, and other electrical parameters of the Ethernet interface.
The leap to iproute2: ip command and basic objects
All of the above still exists, but in modern systems the recommendation is to use iproute2Its main command, ip, offers a coherent syntax based on object + action:
ip [OPCIONES] OBJETO COMANDO [parámetros]
The most common objects are link, address (addr), route, rule, neighbor (neigh), tunnel, maddr, mroute, monitor, ntable, tuntap, xfrm, netns, l2tp, tcp_metrics, tokenamong others. Each one focuses on a specific aspect of the network stack.
- link: manages physical or logical interfaces (state, MTU, flags, MAC).
- address / addr: handles IPv4 and IPv6 addresses associated with interfaces.
- road.: creates, deletes, and displays routes in routing tables.
- neighbor: displays and manipulates the ARP table (or IPv6 neighborhood).
- rule: defines routing policies for multiple tables.
Also, the command ip It includes very useful global options: -4 y -6 to filter by address family, -s for statistics, -br for abbreviated table exit, -o for a single line (ideal for grep o wc), -c to color the exit or -f to choose the protocol family (inet, inet6, bridge, mpls, etc.).
Basic equivalencies: ifconfig vs ip
Where it was previously used ifconfig To view the interfaces and their IP configuration, two iproute2 commands are now recommended:
# Ver direcciones IP y configuración
ip addr show
# Ver información de capa 2 (MAC, MTU, flags)
ip link show
To raise or lower an interfaceThe equivalent would be:
# ifconfig ens33 up
ip link set ens33 up
# ifconfig ens33 down
ip link set ens33 down
Assign an IP address to an interface It also has its "translation". Where you used to do:
ifconfig ens33 192.168.1.1/24
With iproute2, it's done like this, also specifying the device:
ip addr add 192.168.1.1/24 dev ens33
To delete a specific IP address (something that ifconfig doesn't directly support and forces you to use 0.0.0.0), with ip it's as intuitive as changing add by del:
ip addr del 192.168.1.1/24 dev ens33
And if you need create a virtual interface or aliasIn ifconfig you would do it with ens33:1Whereas in ip the option is played label to label that address:
# Alias con etiqueta personalizada
ip addr add 10.0.0.1/8 dev ens33 label ens33:redes
IP address and the ARP table with iproute2
ARP management (or neighbor management in IPv6) is also integrated into iproute2 via the object neighborTo list the neighbors table (equivalent to arp -n):
ip neigh show
If you would like to manually add a permanent ARP entry, you indicate IP, MAC (lladdr), state type and device:
ip neigh add 192.168.0.1 lladdr 00:11:22:33:44:55 \
nud permanent dev ens33
To delete an entry, again they resort to del:
ip neigh del 192.168.0.1 lladdr 00:11:22:33:44:55 \
nud permanent dev ens33
As with all other items, you can always View detailed help with:
ip neigh help
ip route: modern replacement for the route command
The object road. iproute2 is in charge of manage routing tablesBoth the main and secondary missions. Their mission is analogous to that of the old commando unit. routebut with much more power and flexibility.
To View the main routing tableThe following are used:
ip route show
# o
ip route list
If you would like to add a static route To connect to a specific network, you specify the prefix and the gateway (or interface):
# Añadir ruta a 10.8.0.0/24 vía 192.168.1.2
ip route add 10.8.0.0/24 via 192.168.1.2
To delete that path, simply:
ip route del 10.8.0.0/24 via 192.168.1.2
You can also change the gateway of an existing route using chg (o change):
ip route chg 10.8.0.0/24 via 192.168.1.3
La default gateway It is defined with a default route:
# Añadir gateway predeterminado
ip route add default via 192.168.1.1
# Borrarlo usando otra IP de gateway
ip route del default via 192.168.1.254
Multiple routing tables and policies with ip rule
One of the great advantages of iproute2 is the ability to work with multiple routing tables simultaneouslyThis is impossible with net-tools. The Linux kernel allows up to 253 different tables, in addition to the main table (ID 254) and the local table (ID 255, intended for local and broadcast addresses, which you shouldn't touch).
The tables are defined in the file /etc/iproute2/rt_tableswhere you'll see something like this:
# reserved values
255 local
254 main
253 default
0 unspec
To add a new table, simply assign it a number and a name. For example, to create the table redeszone With ID 66, a line is added:
66 redeszone
From there, you can add specific routes to that tableImagine that your device has IP address 10.10.2.2 on the interface ens37and you want that table to route traffic to 10.8.0.0/24 using that interface:
ip route add 10.8.0.0/24 dev ens37 src 10.10.2.2 table redeszone
To delete that path In the secondary table, you indicate the same parameters with del:
ip route del 10.8.0.0/24 dev ens37 src 10.10.2.2 table redeszone
And if you need to define a default gateway within that table, it is done like this:
ip route add default via 10.10.2.1 dev ens37 table redeszone
So that the kernel knows when to use that table instead of the main onerouting rules are added using IP ruleA typical example: that all the traffic from y to 10.10.2.2 Use the table redeszone:
ip rule add from 10.10.2.2/32 table redeszone
ip rule add to 10.10.2.2/32 table redeszone
El state of that table You can check with:
ip route list table redeszone
And the set of active rules It is seen with:
ip rule show
QoS, load balancing, IP tunnels and more with iproute2
Beyond simply replacing ifconfig and route, iproute2 provides a number of advanced features that make it a complete platform for network management on Linux. Some of the most interesting ones are the traffic control and QoS, load balancing across interfaces, IP tunnel creation, and multiple gateway management.
Using the tool tc (traffic control), included in iproute2, is possible implement QoS (Quality of Service)by classifying packets into queues, assigning priorities, limiting the bandwidth of certain flows, or guaranteeing resources to critical traffic (voice, corporate applications, etc.).
The command itself ip allow create IP tunnels that encapsulate IPv4 packets over existing IP infrastructure, a technique widely used in VPNs, interconnection of sites or deployment of virtual networks.
As to load balancing, iproute2 can assign weights to different interfaces and distribute outgoing traffic according to different criteria (source IP, destination IP, ports, etc.). This fits very well with software router scenarios where the Linux server itself acts as a load balancer across multiple links.
Furthermore, by combining multiple routing tables and IP rule configurations, it is possible to design advanced routing scenarios where traffic arriving through an interface must necessarily exit through that same interface, or through different routes depending on origin, traffic type, or destination network.
Persistence of IPs, routes, and rules after reboots
A key aspect when working with ip es que Everything you configure from the command line is volatileWhen the machine restarts, changes to IPs, routes, and rules disappear. Therefore, on live servers, this is essential. copy those settings to the system files.
In Debian and derivatives that use the classic system of / etc / network / interfacesThe IPs and static routes are declared in that file, optionally using directives. post-up to launch commands ip additional when the interface is lifted.
Un very complete example It mixes several interfaces, secondary addresses, and several routing tables. For one interface eth1 with IP 10.10.1.114/29 and table tabla2It could look something like this:
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.10.1.114
netmask 255.255.255.248
post-up ip route add 10.10.1.112/29 dev eth1 src 10.10.1.114 table tabla2
post-up ip route add default via 10.10.1.113 dev eth1 table tabla2
post-up ip rule add from 10.10.1.114/32 table tabla2
post-up ip rule add to 10.10.1.114/32 table tabla2
Other interfaces on the same host can repeat the scheme with different tables (for example, tabla3) to achieve multiple internet access points or logical segmentation using a single Linux server as router advanced.
In distributions that use NetworkManager, netplan, systemd-networkd or equivalent toolsThe philosophy is the same: addresses, routes, rules, and parameters must be entered into their corresponding configuration files so that the system can automatically apply them in each instance. Boot.
Advantages and disadvantages of iproute2 versus net-tools
Read more iproute2 provides a clear unified and modern approach to network management in Linux. Instead of dispersing functionalities among ifconfig, route, arp, netstat and others, concentrates everything into a coherent collection, with homogeneous syntax and native support for IPv4 and IPv6.
The presence of a single central command (ip) that covers interface configuration, addresses, routes, tunnels, QoS, multicast, IPsec policies, network namespaces Furthermore, it facilitates both specific tasks and automated scripting.
In addition, iproute2 incorporates advanced routing features that do not exist in net-tools: multiple tables, policy-based routing with ip ruleLoad balancing between gateways, integration with encapsulation mechanisms, bandwidth management, etc. This makes Linux a high-performance router without the need for specific hardware.
As an added bonus, iproute2 allows test configurations temporarily from the command line and, only when they work, move them to persistent files, reducing the risk of leaving your server inaccessible due to an oversight.
On the less pleasant side, the main drawback is the change of mindset and the learning curveAnyone who has been using it for years ifconfig y route It uses a different syntax and many more concepts (tables, rules, objects, etc.). This requires investing some time in training.
There is also a problem with backward compatibility with older scripts: many automated processes written with net-tools stop working if ifconfig or route disappears on a system, forcing the code to be migrated to iproute2.
Finally, the reality remains that Everything is done via terminal.For those coming exclusively from graphical environments, this may seem intimidating at first, although the power gained more than compensates for the effort if you work with networks professionally.
To master both ifconfig and route as the complete iproute2 ecosystem It puts you in a very comfortable position to move between legacy servers, classic documentation, modern distributions, academic exercises and, of course, hacking and cybersecurity environments, where a thorough understanding of how to configure interfaces, routing tables, ARP, QoS, tunnels and multiple gateways is a clear competitive advantage.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.
