Web linux-server.50webs.com

Linux Server Basics

The ifconfig Command:

The ifconfig command assigns TCP/IP configuration values to network interfaces. Many values can be set with this command, but only a few are really needed: the IP address, the network mask, and the broadcast address. Assume that we have a network that uses the private network address 172.16.0.0 with the subnet mask 255.255.255.0. Further, assume that we need to configure a system named robin.foobird.org that is assigned the address 172.16.5.4. The ifconfig command to configure that interface is:

ifconfig eth0 172.16.5.4 netmask 255.255.255.0 broadcast 172.16.5.255

Note:
The network address 172.16.0.0, which is used as an example in this book, cannot be used to route data across the Internet. It is a private network number that is set aside for use on private networks.

.