Networking
ifconfig |
|
|
|
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).
|
Display data for all interfaces (not supported by HP-UX). |
|
(FreeBSD and AIX) |
List all network interfaces. |
Network interface configuration files
AIX: |
Stored in the ODM; modify with |
|
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-eth |
|
/etc/sysconfig/network/ifcfg-eth DEVICE=name Red HatBOOTPROTO=static|dhcpIPADDR=addrNETMASK=maskONBOOT=yes|no Red Hat onlySTARTMODE=yes|no SuSE only |
SuSE |
|
/etc/sysconfig/network:
|
Red Hat |
|
/etc/HOSTNAME: |
||
Holds the hostname (SuSE). |
||
Solaris: |
/etc/hostname. |
|
The first line holds the hostname. Any additional line(s) hold |
Displaying the system’s MAC address
Get Essential System Administration Pocket Reference 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.