Using ifconfig to change interface configuration

This tip is excerpted from TCP/IP Network Administration, Help for Unix System Administrators, by Craig Hunt, published by O'Reilly and Associates.

You can use the ifconfig command when configuring a device's network interface. But the command also can be used to check the status of that configuration. Once you have checked the configuration of an unknown interface, you can then use the ifconfig command to change the configuration as necessary.

For example, to check an interface identified as 1e0, type the command

% ifconfig 1e0

and, on a Solaris 2.5.1 system, get
1e0: flags=863 mtu 1500 inet 172.16.12.2 netmask ffff0000 broadcast 172.16.255.255

The first line shows the interface name, the flags that define the interfaces characteristics, and the Maximum Transmission Unit (MTU) of this interface. In the example, the interface name is 1e0, and the MTU is 1500 bytes. The flags are displayed as both a numeric value and a set of keywords. The interfaces flags have the numeric value 863, which corresponds to:

UP
The interface is enabled.

BROADCAST
The interface supports broadcasts, which means it is connected to a network that supports broadcasts, such as an Ethernet.

NOTRAILERS
This interface does not support trailer encapsulation. This is an Ethernet-specific characteristic.

RUNNING
This interface is operational.

MULTICAST
This interface supports multicasting.

The second line of ifconfig output displays information that directly relates to TCP/IP. The keyword inet is followed by the Internet address assigned to this interface. Next comes the keyword netmask, followed by the address mask written in hexadecimal. Finally, the keyword broadcast and the broadcast address are displayed.


This was first published in July 2000

Dig deeper on Working With Servers and Desktops

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSDN

SearchEnterpriseWAN

SearchUnifiedCommunications

SearchMobileComputing

SearchDataCenter

SearchITChannel

Close