Tip

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

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.