1 ifconfig SYNOPSIS The ifconfig command assigns addresses to network interfaces. It also displays network interfaces and configures network interface parameters. For IPv4 environments, use the following syntax: ifconfig interface_id [address_family] [address[/bitmask] [dest_address]] [parameters] For IPv6 environments, use the following syntax: ifconfig interface_id address_family [[ip6prefix] address[/bitmask] [dest_address]] [parameters] To display information about interfaces, use the following syntaxes: ifconfig -a [-d] [-u] [-v] [address_family] ifconfig -l [-d] [-u] [-v] [address_family] ifconfig [-v] interface-id [address_family] 2 FLAGS -a Displays information about all interfaces that are configured on a system. -d Displays information about interfaces that are down. -l Displays interface names that are configured on a system. -u Displays information about interfaces that are up. -v Displays detailed information about interfaces, such as hardware addresses and IPv6 timers. 2 DESCRIPTION The ifconfig utility defines the network address of each interface when TCP/IP Services starts. After that, you can use the ifconfig utility to display all interfaces that are configured on a system, to redefine the address of an interface, and to set other operating parameters. NOTE If you want to redefine the interface address or the netmask, you should stop TCP/IP Services first. Otherwise, any TCP/IP processes currently running will continue to use the old address and netmask, and will fail. Any user can query the status of a network interface; only a privileged user can modify the configuration of network interfaces. You specify an interface with the following syntax: ifconfig interface_id This command displays the current configuration for the specified network interface. Refer to the HP TCP/IP Services for OpenVMS Management for information about how to obtain the interface_id. 2 ARGUMENTS address_family Specifies the protocol family for which to report the configuration details. The following table lists valid values for address_ family: Address Type Value IPv4 inet IPv6 inet6 When changing an interface configuration, if the address family is not 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 different protocols, each of which may require a separate naming scheme. address Specifies the network address of the interface being configured. For the 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 Interdomain Routing (CIDR) bitmask (/bitmask). If using the bitmask argument, do not use the netmask parameter. For the inet6 address family, the address argument is either a host name or the 128-bit 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 portion of the address. An IPv6 address typically consists of a 64-bit prefix followed by a 64-bit interface identifier. See the HP TCP/IP Services for OpenVMS Guide to IPv6 manual for more information on IPv6 addresses. ip6prefix Specifies that the address argument is an IPv6 prefix and that the interface identifier is to be appended to it to create a 128-bit IPv6 address when configuring an address on the interface. interface identifier Identifies an interface on a subnet, and is typically the interface's link-layer address. Most prefixes are required to have 64-bit interface identifiers. For 48-bit MAC addresses, the interface identifier is created by inserting the hexadecimal values of 0xFF and 0xFE in the middle of the address and inverting the universal/local bit (bit 7) in the resulting 64-bit address. For example, the 48-bit MAC address 0:0:f8:23:10:f3 becomes the 64-bit interface identifier 2:0:f8:ff:fe:23:10:f3. dest_address Specifies the address of the correspondent on the remote end of a point-to-point link. 2 PARAMETERS abort Closes all TCP connections associated with a network address. Use this parameter when removing aliases or deleting network addresses. This prevents connections from hanging when the network address is deleted. alias alias_address[/bitmask] 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. If you do not specify a bitmask or netmask with the 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: o You can specify only one alias alias_address parameter for each ifconfig command line. o You cannot specify an alias and a primary address on the same command line. -alias alias_address Removes the network address specified. This can be used either if you incorrectly specified an alias or if an alias is no longer needed. The -alias parameter functions in the same manner as the delete parameter. aliaslist address_list[/bitmask] Establishes a range of additional network addresses for this interface. The range can be 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. (IPv4 only) -aliaslist 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. (IPv4 only) allmulti Enables the reception of all multicast packets. -allmulti Disables the reception of all multicast packets. arp Enables the use of the Address Resolution Protocol (ARP) in mapping between network-level addresses and link-level addresses. This parameter is on by default. -arp Disables the use of the ARP. Use of this parameter is not recommended. broadcast broad_address Specifies the address to use to represent broadcasts 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 for more information). delete [net_address] Removes the network address specified. Use this parameter if you incorrectly specified an alias, or if it was no longer needed. If you incorrectly set an NS address, specifying the host portion, remove all NS addresses to respecify the host portion. If no address is specified, all network addresses for the interface are deleted. Be careful when you use this parameter. If you either specify the network 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. down 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. ip6dadtries value Specifies the number of consecutive Neighbor Solicitation messages that your system transmits while it performs Duplicate Address Detection on a tentative address. (IPv6 only) ip6hoplimit hops Sets the default number of hops to be included in transmitted unicast IP packets. (IPv6 only) ip6interfaceid id 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 IPv6 interface ID abcd:1234 for the interface: ifconfig ln0 ip6interfaceid ::abcd:1234 ipv6 (IPv6 only) ip6mtu mtu_value Alters the maximum transfer unit (MTU) for messages that your system transmits on the link. (IPv6 only) ip6nonud Disables Neighbor Unreachability Detection (NUD) on the interface. (IPv6 only) ip6reachabletime time Sets the time, in milliseconds, that your system con siders a neighbor is reachable after your system receives a reachability confirmation message. (IPv6 only) ip6retranstimer value Sets the time interval, in milliseconds, between Neighbor Solicitation messages to a neighbor. (IPv6 only) ipmtu mtu_value 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. ipv6 Initializes IPv6-related data structures and assigns an IPv6 link-local address to the interface. (IPv6 only) -ipv6 Removes any IPv6 configuration associated with the interface, including all IPv6 addresses and IPv6 routes through the interface. This is equivalent to the following command: ifconfig interface inet6d delete (IPv6 only) metric number 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 ROUTED and GATED, with higher metrics indicating that the route is less favorable. ndna [ address ] Sends an unsolicited ICMPv6, Neighbor Advertisement for each address configured on the interface. If the address is provided, then send a Neighbor Advertisment for the specified address only. If a DNS alias is used as the address, a Neighbor Advertisement is sent for each address that comprises the DNS alias name. (IPv6 only) netmask mask 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 notation, 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. (IPv4 only) up 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. 2 DISPLAY_OPTIONS When you issue the ifconfig command for an interface you might see any of the following options displayed: BROADCAST The interface supports broadcast packets. This is a read-only option that is set by the driver. LOOPBACK 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. MULTICAST The interface supports multicast packets. This is a read-only option that is set by the driver and does not mean that a multicast address is configured for the interface. NOARP The interface is not using address resolution protocol (ARP). It will neither transmit nor respond to ARP requests. NOCHECKSUM The interface does not perform checksums on transmitted or received packets. Use this option only on very reliable network media. POINTOPOINTThe interface is point-to-point link. This is a read- only option that is set by the driver. RUNNING The driver has allocated resources for the interface, and is ready to transmit and receive packets. This is a read-only option that is set by the driver. It is not applicable to loopback devices. SIMPLEX The interface cannot receive its own transmissions. This is a read-only option that is set by the driver. 2 EXAMPLES o To query the status of an interface we0, enter: $ ifconfig we0 o To configure the local loopback interface, enter: $ ifconfig lo0 inet 127.0.0.1 up Only a privileged user can modify the configuration of a network interface. o To configure a ie0 interface, enter: $ ifconfig ie0 212.232.32.1/22 The broadcast address is 212.232.35.255 as the 22-bit mask specifies four Class C networks. o To configure an address that is not protected by failSAFE IP, enter: $ ifconfig -fs ie0 210.208.19.3/16 o To configure an alias address with a home interface, so that failSAFE IP will attempt to return the address to its home after the home recovers from a failure, enter: $ ifconfig we0 home alias 156.47.92.8/24 o To configure IPv6 on a ie0 interface, enter: $ ifconfig ie0 ipv6 up o To configure an IPv6 link-local alias address on interface ie0, enter: $ ifconfig ie0 inet6 alias fe80::202:a5ff:fe60:abcd o To add alias 132.50.40.35 with a netmask of 255.255.255.0 in CIDR format to interface we0, enter: $ ifconfig we0 alias 132.50.40.35/24 o 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 we0 interface, enter: $ ifconfig we0 aliaslist 132.240.32-36.40-50/24 o To add network addresses 40 through 50, inclusive, 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 we0 interface, enter: $ ifconfig we0 aliaslist 132.240.32,64,96.40-50/24 To stop Ethernet interface we0, delete all addresses associated with the interface, and close all TCP connections, enter: $ ifconfig we0 down delete abort 145.92.16.1: aborting 7 tcp connection(s) o To delete the alias address 145.92.16.2 on interface we0 and close all TCP connections, enter: $ ifconfig we0 -alias 145.92.16.2 abort 145.92.16.2: aborting 2 tcp connection(s) o To create an IPv6 address for prefix AB:CD:CE:AB, enter: $ ifconfig we0 inet6 ip6prefix AB:CD:CE:AB::/64 o To force an interface into a failed state, enter: $ ifconfig ie0 fail Note that this causes all routes that use IE0 to be deleted. o To force an interface to recover from a failed state, enter: $ ifconfig ie0 -fail Note that only interface routes are recovered. Other static routes must be restored manually. o To display the names of the interfaces on the system only, enter: $ ifconfig -l IE0 IE1 IE2 IE3 LO0 TN0 TN1 WE0 o To display the hardware and IP address of interface we0, enter: $ ifconfig -v we0 we0: options=c63 HWaddr 8:0:2b:9e:14:a2 inet 192.140.34.16 netmask ffffff00 broadcast 192.140.34.255 ipmtu 1500