Interface Configuration for IP
After setting up your hardware as explained in Chapter 4, you have to make these devices known to the kernel networking software. A couple of commands are used to configure the network interfaces and initialize the routing table. These tasks are usually performed from the network initialization script each time you boot the system. The basic tools for this process are called ifconfig (where “if” stands for interface) and route.
ifconfig is used to make an interface accessible to the kernel networking layer. This involves the assignment of an IP address and other parameters, and activation of the interface, also known as “bringing up” the interface. Being active here means that the kernel will send and receive IP datagrams through the interface. The simplest way to invoke it is with:
ifconfiginterface
ip-address
This command assigns ip-address
to
interface
and activates it. All other
parameters are set to default values. For instance, the default
network mask is derived from the network class of the IP address, such
as 255.255.0.0 for a class B
address. ifconfig is described in detail in the
section Section 5.8.”
route allows you to add or remove routes from the kernel routing table. It can be invoked as:
route [add|del] [-net|-host]target
[if
]
The add
and del
arguments determine
whether to add or delete the route to
target
. The -net
and
-host
arguments tell the route command whether the target is a network or a host (a host is assumed if you ...
Get Linux Network Administrator's Guide, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.