Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ifconfig(8) [osf1 man page]

ifconfig(8)						      System Manager's Manual						       ifconfig(8)

NAME
ifconfig - Configures or displays network interface parameters SYNOPSIS
For the AF_INET address family, use the following syntax: /usr/sbin/ifconfig interface_id [address_family] [address[/bitmask] [dest_address]] [parameters] For the AF_INET6 address family, use the following syntax: /usr/sbin/ifconfig interface_id address_family [[ip6prefix] address[/bitmask] [dest_address]] [parameters] For displaying interface information, use the following syntaxes: /usr/sbin/ifconfig -a [-d] [-u] [-v] [address_family] /usr/sbin/ifconfig -l [-d] [-u] [-v] [address_family] /usr/sbin/ifconfig [-v] inter- face-id [address_family] The ifconfig command assigns and displays an address to a network interface, and configures network interface parameters. FLAGS
Displays information about all interfaces that are configured on a system. Displays information about interfaces that are down only. Dis- plays interface names only that are configured on a system. Displays information about interfaces that are up only. Displays verbose information about interfaces, such as hardware addresses and IPv6 timers. DESCRIPTION
You use the ifconfig command at boot time to define the network address of each interface. You can also use the ifconfig command at other times to display all interfaces that are configured on a system, to redefine the address of an interface, or to set other operating parame- ters. If you want to redefine the interface address or the netmask, use the SysMan Menu utility. Otherwise, any daemons currently running will use the old address and netmask, and will fail. The SysMan Menu utility makes the necessary changes and restarts the network ser- vices. Any user can query the status of a network interface; only the superuser can modify the configuration network interfaces. You specify an interface with the ifconfig interface_id syntax. (See your hardware documentation for information on obtaining an interface ID.) If you specify only an interface_id, the ifconfig command displays the current configuration for the specified network interface only. If a protocol family is specified by the address_family parameter, ifconfig reports only the configuration details specific to that proto- col family. The following table lists valid values for address_family: ----------------------- Address Family Value ----------------------- AF_INET inet AF_INET6 inet6 ----------------------- When changing an interface configuration, if the address family is not AF_INET, you must specify an address family, which may alter the interpretation of any parameters that follow. You must specify an address family because an interface can receive transmissions in differ- ent protocols, each of which may require a separate naming scheme. The address argument is the network address of the interface being configured. For the AF_INET address family, the address argument is either a hostname or an Internet address in the standard dotted-decimal notation with or without the optional Classless Inter-Domain Rout- ing (CIDR) bitmask (/bitmask). If using the bitmask argument, do not use the netmask parameter. For the AF_INET6 address family, the address argument is either a hostname or the 128-bit Internet Protocol Version 6 (IPv6) address, as follows: x:x:x:x:x:x:x:x In this format, each x is the hexadecimal value of a 16-bit piece of the address. See the Network Programmer's Guide for more information on IPv6 addresses. The ip6prefix argument specifies that the interface identifier is to be appended to the address argument when configuring an address on the interface. The interface identifier uniquely identifies an interface on a subnet, and is typically the interface's link-layer address. The destination address (dest_address) argument specifies the address of the correspondent on the remote end of a point-to-point link. Parameters Closes all TCP connections associated with a network address. Use this parameter when removing aliases or deleting network addresses. This prevents users from experiencing a hanging connection when the network address is deleted. Creates or modifies a set of redundant adapters (NetRAIN). The ifconfig interface-id parameter must be a NetRAIN virtual interface name of the form nrx, where x is the unit num- ber (Valid unit numbers are 0 to nr_maxdev-1. See sys_attrs_netrain(5) for a description of nr_maxdev and other netrain subsystem attributes. You can adjust this limit by using dxkerneltuner or the sysconfig command). If the NetRAIN virtual interface does not exist, it is created. You can also specify multiple interface-id parameters when creating a NetRAIN set. The interface-id specified must represent adapters of the same type connected to the same LAN segment. You can also modify an existing NetRAIN set by adding one interface-id at a time. The interface-id specified must represent an adapter of the same type and connected to the same LAN segment as other adapters in the NetRAIN set. Before creating a NetRAIN set, make sure that niffd is running on your system. See the Network Administration manual for complete information on configuring a NetRAIN interface. [AF_INET only] Establishes an additional network address for this interface. This can be useful when changing network numbers and you want to continue to accept packets addressed to the old interface. This alias is in effect only until the system is rebooted. To establish this alias automatically each time the system is booted, edit the inet.local file and add the ifconfig alias entries to it. If you do not specify a bitmask or netmask with an alias address, the default netmask is based on the alias address's network class. If you are using the optional bitmask argument, do not use the netmask argument. This parameter has the following restrictions: You can specify only one alias alias_address parameter for each ifconfig command line. You cannot specify an alias and an interface-id on the same command line. [AF_INET only] Removes the network address speci- fied. This can be used either if you incorrectly specified an alias or if an alias is no longer needed. The -alias parameter func- tions in the same manner as the delete parameter. [AF_INET only] Establishes a range of additional network addresses for this interface. The range can be either a comma-separated list or a hyphenated list, and is inclusive. You can also specify the optional CIDR bitmask (/bitmask) argument at the end of the list. Do not use a comma-separated list and a hyphenated list for a range. See the "Examples" section for valid examples of the aliaslist parameter. If you do not specify a netmask with the alias list, the default netmask is based on the alias address's network class. [AF_INET only] Removes a range of network addresses for this interface. This can be useful when deleting network numbers and you want to keep the primary interface address. The alias list rules are the same as for the aliaslist parameter. Enables the reception of all multicast packets. Disables the reception of all multicast packets. Enables the use of the Address Resolution Protocol (ARP) in mapping between network-level IPv4 addresses and link-level addresses. This parameter is on by default. Disables the use of the ARP. Use of this parameter is not recommended. See arp(8) for more information. Specifies the address to use to represent broad- casts to the network. The default broadcast address is the address with a host part consisting of all 1s (ones). Note that the computation of the host part is dependent on netmask (see the description of the netmask parameter). Enables driver-dependent debug code. This might turn on extra console error logging. (See your hardware documentation for further information.) Disables driver- dependent debug code. Removes the network address specified. This would be used if you incorrectly specified an alias, or if it was no longer needed. If you have incorrectly set an NS address having the side effect of specifying the host portion, removing all NS addresses will allow you to respecify the host portion. Be careful when you use this parameter. If you either specify the net- work address before the delete parameter or specify no network address after the delete parameter, all IPv4 and IPv6 network addresses for the interface and IPv6 routes are deleted. IPv4 routes are not deleted. Marks an interface as not working (down), which keeps the system from trying to transmit messages through that interface. If possible, the ifconfig command also resets the interface to disable reception of messages. Routes that use the interface, however, are not automatically disabled. Enables access filtering on the interface. Reads the /etc/ifaccess.conf file and constructs an interface access filter based on entries in the file. Interface access filtering provides a mechanism for detecting and preventing IP spoofing attacks. (See CERT Advisory CA-95:01). The source addresses of IP input packets are checked against access filter entries; packets receive the action associ- ated with the first matching entry. The following actions are valid: permit, deny, or denylog; the final filter entry is a default permit all. See ifaccess.conf(4) for more information. Use the netstat(1) command to display the current access filters for the interface. Disables access filtering on the interface. [AF_INET6 only] Overrides that default interface ID, which depends on the underlying link type (for example, Ethernet, FDDI, and Token Ring), and specifies id as the interface ID. For example, if your system has the Ethernet hardware address 08-00-2b-2a-1e-d3, the following command generates the inet6 link-local address fe80::a00:2bff:fe2a:1ed3 for the interface: ifconfig ln0 ipv6 On the same system, the following command generates the inet6 interface ID abcd:1234 for the interface: ifconfig ln0 ip6interfaceid ::abcd:1234 ipv6 Specifies an Internet host willing to receive IP packets encapsulating packets bound for a remote network. [AF_INET only] Alters the size of the maximum transfer unit (MTU) for messages that your system transmits. It might be necessary to reduce the MTU size so that bridges connecting token rings can transfer frames without error. [AF_INET6 only] Initializes IPv6-related data structures and assigns an IPv6 link-local address to the interface. [AF_INET6 only] Removes any IPv6 configuration associated with the interface, including all IPv6 addresses and IPv6 routes through the interface. This command is equivalent to the ifconfig interface inet6 delete com- mand. [AF_INET6 only] Specifies the number of consecutive Neighbor Solicitation messages that your system transmits while it performs Duplicate Address Detection on a tentative address. [AF_INET6 only] Sets the default number of hops to be included in transmitted unicast IP packets. [AF_INET6 only] Alters the maximum transfer unit (MTU) for messages that your system transmits on the link. [AF_INET6 only] Disables Neighbor Unreachability Detection (NUD) on the interface. [AF_INET6 only] Sets the time, in milliseconds, that your sys- tem considers a neighbor is reachable after your system receives a reachability confirmation message. [AF_INET6 only] Sets the time interval, in milliseconds, between Neighbor Solicitation messages to a neighbor. Sets the routing metric, or number of hops, for the interface to the value of number. The default value is 0 (zero) if number is not specified, indicating that both hosts are on the same network. The routing metric is used by the routed and gated daemons, with higher metrics indicating that the route is less favorable. Enable NetRAIN monitoring on this interface. If the monitoring code determines that the interface is not operational, a message is sent to the console and to a log file. [AF_INET only] Enables the use of multiple subnets on the interface. This is required when an IP alias address is configured on an interface and it is in a different subnet than the primary IP address of the interface. [AF_INET only] Dis- ables the use of multiple subnets on the interface. [AF_INET only] Specifies how much of the address to reserve for subdividing networks into sub-networks. This parameter can only be used with an address family of inet. Do not use this parameter if you are specifying the CIDR mask (/bitmask) with the address argument, alias parameter, or aliaslist parameter. The mask variable includes both the network part of the local address and the subnet part, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number beginning with 0x, in the standard Internet dotted-decimal nota- tion, or beginning with a name. The mask contains 1s (ones) for the bit positions in the 32-bit address that are reserved for the network and subnet parts, and 0s (zeros) for the bit positions that specify the host. The mask should contain at least the standard network portion. The default netmask is based on the address parameter's network class. Sets two NetRAIN interface timing parameters. The t1 param- eter specifies the time period, in seconds, that the traffic monitor thread delays between reads of the interface counters when the network is running normally. If there is no change in the received byte count for t1 seconds, the traffic monitor thread issues a yellow alert. The recommended t1 value is 4. The t2 parameter specifies the traffic-free time period, in seconds, that must pass before the traffic monitor thread declares the interface dead. The recommended t1 value is 10 for Ethernet interfaces and 16 for Asynchronous Transfer Mode (ATM) LAN Emulation (LANE) interfaces. NetRAIN uses Network Interface Failure Finder (NIFF) to monitor the NetRAIN interfaces. See nifftmt(7) for more information. Asso- ciates the Media Access Control (MAC) address (mac-address) with an IP network address. You must specify an alias address with this command. This association is in effect only until the system is rebooted. To establish this association automatically each time the system is booted, edit the inet.local file and add the ifconfig physaddr entries to it. Disassociates the MAC address (mac- address) from an IP network address. Sets the interface into promiscuous mode. This directs the network interface to receive all packets off the network, rather than just those packets directed to the host. Disables the promiscuous mode of the interface. This is the default. Removes one or all interfaces attached to a NetRAIN interface. If you do not specify an interface-id, all inter- faces are removed from the NetRAIN set, their default hardware addresses are restored, and the UP flag is cleared. The hardware address of the NetRAIN virtual interface is set to 00:00:00:00:00:00 and its UP flag is cleared. If you specify only one interface-id and it is a member of the NetRAIN interface (nrx), the interface is removed from the NetRAIN set. If interface-id is also the active interface and there are other interfaces in the set, the active interface is switched to another interface in the set. If there is only one interface in the NetRAIN set, the following two commands are equivalent: ifconfig nrx remove ifconfig nrx remove interface-id You can also reconfigure the NetRAIN virtual interface by using the add command. Sets the speed at which the token ring adapter transmits and receives on the token ring network to value. The value can be either 4 for a ring speed of 4Mbs or 16 for 16Mbs. The adapter speed must match the signal speed of the token ring. This parameter also determines the speed (regular or fast Ethernet) and half- or full-duplex mode operation on the tu interface when that interface is using the twisted-pair port as follows: -------------------------------------- Value Configuration -------------------------------------- 10 10 Mbps Ethernet half-duplex 20 10 Mbps Ethernet full-duplex 100 100 Mbps Ethernet half-duplex 200 100 Mbps Ethernet full-duplex -------------------------------------- After the interface is online, you can use the ifconfig up and down options to change the speed value dynamically. Stop adapter transmission with down and set the speed in the same command line. Then specify up without a speed value to restart the adapter. Force a NetRAIN interface to failover to another interface in the NetRAIN set. If the ifconfig interface-id specified is the NetRAIN virtual interface, the next available interface in the set becomes active. If the ifconfig interface-id is a member of the NetRAIN set, the interface-id specified becomes the active member. If the interface-id specified is not operational, the switch command has no effect. Requests the use of a trailer link-level encapsulation when sending messages. If a network interface supports trailers, the system will, when possible, encapsulate outgoing messages in a manner that minimizes the number of memory-memory copy operations performed by the receiver. On networks that support the Address Resolution Protocol (see arp), this flag indicates that the system should request that other systems use trailers when sending to this host. Similarly, trailer encapsulations will be sent to other hosts that have made such requests. Currently used by Internet protocols only. Dis- ables the use of a trailer link-level encapsulation. This is the default. Sets the trust group identifier for the interface. Trust group identifiers are passed from the kernel to the screend daemon, and indicate the color of the interface on which a packet was received and the color of the interface to which a packet is intended, as indicated by the kernel routing tables. The group can be one of the primary colors in the visible spectrum (for example, red, orange, yellow, green, blue, indigo, and violet). The screend daemon can optionally use trust group information to make packet screening decisions. By default, the trust group identifier is unknown, meaning any interface. Only application gateways for firewall services use trust group identifiers. Marks an interface as working (up). This parameter is used automatically when setting the first address for an interface, or can be used to enable an interface after an ifconfig down command. If the interface was reset when previously marked with the parameter down (see the following section for a description of this parameter), the hardware will be reinitialized. Display Flags When you issue the ifconfig command for an interface you might see any of the following flags: The interface will receive all multicast packets. The interface supports broadcast packets. This is a read-only flag that is set by the driver. Driver-dependent debugging is enabled. The interface is a loopback mode. Packets transmitted on this interface will be looped back in the driver and not be transmitted out on the network. The interface supports multicast packets. This is a read-only flag that is set by the driver, does not mean that a multicast address is configured for the interface. Multiple networks are configured on the interface. This means that an IP alias is in a different subnet than the primary IP address. The interface is not using address resolution protocol (ARP). It will neither transmit nor respond to ARP requests. The interface does not perform checksums on transmitted or received packets. Use this only on very reliable net- work media. Trailer link-level encapsulation for transmitted packets is disabled. The interface is actively transmitting packets. This is a read-only flag that is set by the driver. All packets transmitted on this interface are copied and passed to the packet filter pro- gram. The interface is point-to-point link. This is a read-only flag that is set by the driver. The interface is in promiscuous mode. All packets received are copied and passed to the packet filter program. UP interface marked DOWN due to cluster quorum loss. The driver has allocated resources for the interface, and is ready to transmit and receive packets. This is a read-only flag that is set by the driver. It is not applicable to loopback devices, for example, lo0. The interface cannot hear its own transmissions. This is a read-only flag that is set by the driver. The interface is up. This flag is turned on when an address has been configured on the interface. The interface supports variable Maximum Transmission Unit (MTU) sizes. The is a read-only flag that is set by the driver. EXAMPLES
To query the status of serial line interface sl0, enter: $ ifconfig sl0 sl0: flags=10<POINTOPOINT> To configure the local loopback inter- face, enter: # ifconfig lo0 inet 127.0.0.1 up Only a user with superuser authority can modify the configuration of a network interface. To configure a ln0 interface, enter: # ifconfig ln0 212.232.32.1/22 The broadcast address is 212.232.35.255 as the 22-bit mask specifies four Class C networks. To configure the token ring interface for a 4 Mbps token ring with a netmask of 255.255.255.0 in CIDR format, enter: # ifconfig tra0 130.180.4.1/24 speed 4 To stop the token ring interface and start it for a 16 Mbps token ring, enter: # ifconfig tra0 down # ifconfig tra0 speed 16 up To configure IPv6 on a tu0 interface, enter: # ifconfig tu0 ipv6 up To create a NetRAIN set nr1 with the Ethernet interfaces tu0 and tu2 as the set members, enter: # ifconfig nr1 add tu0,tu2 To set the IP address of this interface to 18.240.32.40, enter: # ifconfig nr1 inet 18.240.32.40 To view this set, enter: # ifconfig nr1 nr1: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX> NetRAIN Attached Interfaces: ( tu0 tu2 ) Active Interface: ( tu0 ) inet 18.240.32.40 netmask ffffff00 broadcast 18.240.32.255 ipmtu 1500 To add interfaces tu1 and tu3 to this set, enter: # ifconfig nr1 add tu1 # ifconfig nr1 add tu3 To remove the interface tu0 from the NetRAIN set created in the previous example, enter: # ifconfig nr1 remove tu0 To disassemble the entire NetRAIN set created in the previous example, enter: # ifconfig nr1 remove To add alias 132.50.40.35 with a netmask of 255.255.255.0 in CIDR format to interface tu0, enter: # ifconfig tu0 alias 132.50.40.35/24 To add network addresses 40 through 50, inclusive, to subnets 18.240.32, 18.240.33, 18.240.34, 18.240.35, and 18.240.36 with a netmask of 255.255.255.0 in CIDR format to the tu0 interface, enter: # ifconfig tu0 aliaslist 132.240.32-36.40-50/24 To add network addresses 40 through 50, inclu- sive, to subnets 18.240.32, 18.240.64, and 18.240.96 with a netmask of 255.255.255.0 in CIDR format to the tu0 interface, enter: # ifconfig tu0 aliaslist 132.240.32,64,96.40-50/24 To stop Ethernet interface tu0, delete all addresses associated with the interface, and close all TCP connections, enter: # ifconfig tu0 down delete abort 145.92.16.1: aborting 7 tcp connection(s) To delete the alias address 145.92.16.2 on interface tu0 and close all TCP connections, enter: # ifconfig tu0 -alias 145.92.16.2 abort 145.92.16.2: aborting 2 tcp connection(s) To associate MAC address aa:01:81:43:02:11 with the alias address 145.92.16.2, enter: # ifconfig tu0 alias 145.92.16.2 physaddr aa:01:81:43:02:11 To disassociate MAC address aa:01:81:43:02:11 from the alias address 145.92.16.2, enter: # ifconfig tu0 -alias 145.92.16.2 -physaddr aa:01:81:43:02:11 To display the names of the interfaces on the system only, enter: # ifconfig -l fta0 lo0 tu0 tu1 To display the hardware and IP address of interface tu0, enter: # ifconfig -v tu0 tu0: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX> HWaddr 8:0:2b:9e:14:a2 inet 192.140.34.16 netmask ffffff00 broadcast 192.140.34.255 ipmtu 1500 DIAGNOSTICS
The broadcast option was specified without an address parameter. The bitmask specified is not in the range of 1 to 32, inclusive. The netmask option was specified together with a CIDR bitmask. The netmask option was specified without an address parameter. You specified more than one alias alias_address parameter on the same ifconfig command line or you specified an alias and an interface-id on the same command line. FILES
Specifies the command path Interface access filtering configuration file. RELATED INFORMATION
Commands: netstat(1), niffconfig(8), pfconfig(8), sysconfig(8). Daemons: gated(8), routed(8), screend(8). Files: ifaccess.conf(4), inet.local(4). Networking: nifftmt(7), nr(7). System Attributes: sys_attrs_netrain(5). Network Administration delim off ifconfig(8)
Man Page