O'Reilly logo

Essential System Administration Pocket Reference by Æleen Frisch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Networking

ifconfig

ifconfig lo0 localhost up

ifconfig interface ip-address netmask mask

The first form configures the loopback interface. The second form assigns the specified IPv4 address and subnet mask to interface. FreeBSD and Solaris allow you to replace the address and netmask parameters (including the keywords) with a CIDR address.

Displaying information about network interfaces

ifconfig [options] [interface]

Display the configuration of the specified interface(s).

-a

Display data for all interfaces (not supported by HP-UX).

-l

(FreeBSD and AIX)

List all network interfaces.

Network interface configuration files

AIX:

Stored in the ODM; modify with mktcpip or SMIT.

FreeBSD:

/etc/rc.conf:

hostname=″name″ifconfig_iface=″ip-addr netmask mask

HP-UX:

/etc/rc.config.d/netconf:

HOSTNAME=″name″INTERFACE_NAME[n]=nameIP_ADDRESS[n]=addrSUBNET_MASK[n]=maskINTERFACE_STATE[n]=up|down

n is the interface number (starting at 0).

Linux:

/etc/sysconfig/networking/devices/ifcfg-ethnRed Hat

/etc/sysconfig/network/ifcfg-ethn

DEVICE=name                 Red HatBOOTPROTO=static|dhcpIPADDR=addrNETMASK=maskONBOOT=yes|no               Red Hat onlySTARTMODE=yes|no            SuSE only

SuSE

/etc/sysconfig/network:

HOSTNAME=″name

Red Hat

/etc/HOSTNAME:

Holds the hostname (SuSE).

Solaris:

/etc/hostname.iface:

The first line holds the hostname. Any additional line(s) hold ifconfig command arguments (optional).

Displaying the system’s MAC address

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required