InnerhalbNach weiteren Dokumenten suchenSupport-Ressourcen | Dieses Buch im PDF-Format herunterladen (4770 KB)
ifconfig(1M)NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | LOGICAL INTERFACES | INTERFACE GROUPS | CONFIGURING IPv6 INTERFACES | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO | DIAGNOSTICS | NOTES NAME
SYNOPSIS
/usr/sbin/ifconfig interface [address_family] [address [/prefix_length] [dest_address]] [addif address [/prefix_length]] [removeif address [/prefix_length]] [arp| -arp] [auth_algs authentication algorithm] [encr_algs encryption algorithm] [encr_auth_algs authentication algorithm] [auto-revarp] [broadcast address] [deprecated| -deprecated] [destination dest_address] [[failover]| [-failover]] [group[[name]| ""]] [index {if_index}] [metric n] [modlist] [modinsert mod_name@pos] [modremove mod_name@pos] [mtu n] [netmask mask] [plumb] [unplumb] [private| -private] [nud| -nud] [set [address] [/netmask]] [[standby]| [-standby]] [subnet subnet_address] [tdst tunnel_dest_address] [token address/prefix_length] [tsrc tunnel_src_address] [trailers| -trailers] [up] [down] [xmit| -xmit] /sbin/ifconfig interface {auto-dhcp| dhcp} [primary] [wait seconds] drop| extend| inform| ping| release| start| status /usr/sbin/ifconfig interface {auto-dhcp| dhcp} [primary] [wait seconds] drop| extend| inform| ping| release| start| status DESCRIPTIONThe command ifconfig is used to assign an address to a network interface and to configure network interface parameters. The ifconfig command must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters. If no option is specified, ifconfig displays the current configuration for a network interface. If an address family is specified, ifconfig reports only the details specific to that address family. Only the superuser may modify the configuration of a network interface. Options appearing within braces ({}) indicate that one of the options must be specified. The two versions of ifconfig, /sbin/ifconfig and /usr/sbin/ifconfig, behave differently with respect to name services. The order in which names are looked up by /sbin/ifconfig when the system is booting is fixed and cannot be changed. In contrast, changing /etc/nsswitch.conf may affect the behavior of /usr/sbin/ifconfig. The system administrator may configure the source and lookup order in the tables by means of the name service switch. See nsswitch.conf(4) for more information. DHCP ConfigurationThe third and fourth forms of this command are used to control the Dynamic Host Configuration Protocol ("DHCP") configuring of the interface. DHCP is only available on interfaces for which the address family is inet. In this mode, ifconfig is used to control operation of dhcpagent(1M), the DHCP client daemon. Once an interface is placed under DHCP control by using the start operand, ifconfig should not, in normal operation, be used to modify the address or characteristics of the interface. If the address of an interface under DHCP is changed, dhcpagent will remove the interface from its control. OPTIONS
The following options are supported: OPERANDS
The interface operand, as well as address parameters that affect it, are described below. LOGICAL INTERFACESSolaris TCP/IP allows multiple logical interfaces to be associated with a physical network interface. This allows a single machine to be assigned multiple IP addresses, even though it may have only one network interface. Physical network interfaces have names of the form driver-name physical-unit-number, while logical interfaces have names of the form driver-name physical-unit-number:logical-unit-number. A physical interface is configured into the system using the plumb command. For example:
Once a physical interface has been "plumbed", logical interfaces associated with the physical interface can be configured by separate plumb or addif options to the ifconfig command.
allocates a specific logical interface associated with the physical interface le0. The command
allocates the next available logical unit number on the le0 physical interface and assigns an address and prefix_length. A logical interface can be configured with parameters ( address,prefix_length, and so on) different from the physical interface with which it is associated. Logical interfaces that are associated with the same physical interface can be given different parameters as well. Each logical interface must be associated with an existing and "up" physical interface. So, for example, the logical interface le0:1 can only be configured after the physical interface le0 has been plumbed. To delete a logical interface, use the unplumb or removeif options. For example,
will delete the logical interface le0:1. INTERFACE GROUPSIf a physical interface shares an IP prefix with another interface, these interfaces are collected into an interface group. IP uses an interface group to rotate source address selection when the source address is unspecified, and in the case of multiple physical interfaces in the same group, to scatter traffic across different IP addresses on a per-IP-destination basis. See netstat(1M) for per-IP-destination information. This feature may be enabled by using ndd(1M). One can also use the group keyword to form a multipathing group. When multipathing groups are used, the functionality of the interface group is subsumed into the functionality of the multipathing group. A multipathing group provides failure detection and repair detection for the interfaces in the group. See in.mpathd(1M) and System Administration Guide, Volume 3. The interface groups formed using ndd(1M) will be made obsolete in the future. Accordingly, it is advisable to use form multipathing groups using the group keyword. CONFIGURING IPv6 INTERFACESWhen an IPv6 physical interface is plumbed and configured "up" with ifconfig, it is automatically assigned an IPv6 link-local address for which the last 64 bits are calculated from the MAC address of the interface.
The following example shows that the link-local address has a prefix of fe80::/10.
If an advertising IPv6 router exists on the link advertising prefixes, then the newly plumbed IPv6 interface will autoconfigure logical interface(s) depending on the prefix advertisements. For example, for prefix advertisements fec0:0:0:55::/64 and 3ff0:0:0:55::/64, the autoconfigured interfaces will look like:
Even if there are no prefix advertisements on the link, you can still assign site-local and global addresses manually, for example:
To configure boot-time defaults for the interface le0, place the following entries in the /etc/hostname6.le0 file: addif fec0::55:a00:20ff:fe8e:f3ad/64 up addif 3ff0::55:a00:20ff:fe8e:f3ad/64 up Link-local addresses are only used for on-link communication and are not visible to other subnets. Configuring IPv6/IPv4 tunnelsAn IPv6 over IPv4 tunnel interface can send and receive IPv6 packets encapsulated in an IPv4 packet. Create tunnels at both ends pointing to each other. IPv6 over IPv4 tunnels require the tunnel source and tunnel destination IPv4 and IPv6 addresses. Solaris 8 supports both automatic and configured tunnels. For automatic tunnels, an IPv4-compatible IPv6 address is used. The following demonstrates auto-tunnel configuration:
where IPv4-address is the IPv4 address of the interface through which the tunnel traffic will flow, and IPv4-address, ::<IPv4-address>, is the corresponding IPv4-compatible IPv6 address. The following is an example of a configured tunnel:
This creates a configured tunnel between my-ipv4-address and peer-ipv4-address with corresponding link-local addresses. For tunnels with global or site-local addresses, the logical tunnel interfaces need to be configured in the following form:
For example,
To show all IPv6 interfaces that are up and configured:
EXAMPLESExample 1 Using the ifconfig CommandIf your workstation is not attached to an Ethernet, the le0 interface should be marked "down" as follows:
Example 2 Printing Addressing InformationTo print out the addressing information for each interface, use the following command:
Example 3 Resetting the Broadcast AddressTo reset each interface's broadcast address after the netmasks have been correctly set, use the next command:
Example 4 Changing the Ethernet AddressTo change the Ethernet address for interface le0, use the following command:
Example 5 Configuring an IP-in-IP TunnelTo configure an IP-in-IP tunnel, first plumb it with the following command:
Then configure it as a point-to-point interface, supplying the tunnel source and the tunnel destination:
Tunnel security properties must be configured on one invocation of ifconfig:
Example 6 Requesting a Service Without Algorithm PreferenceTo request a service without any algorithm preferences, specify any:
Example 7 Disabling All SecurityTo disable all security, specify any security service with none as the algorithm value:
or
FILESATTRIBUTESSee attributes(5) for descriptions of the following attributes: /usr/sbin
/sbin
SEE ALSOdhcpinfo(1), dhcpagent(1M), in.mpathd(1M), in.routed(1M), ndd(1M), netstat(1M), ethers(3SOCKET), gethostbyname(3NSL), getnetbyname(3SOCKET), hosts(4), netmasks(4), networks(4), nsswitch.conf(4), attributes(5), arp(7P),ipsecah(7P),ipsecesp(7P),tun(7M) DIAGNOSTICS
ifconfig sends messages that indicate if: NOTESIt is recommended that the names broadcast, down, private, trailers, up, and the other possible option names not be selected when choosing host names. Choosing any one of these names as host names will cause bizarre problems that can be extremely difficult to diagnose. NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | LOGICAL INTERFACES | INTERFACE GROUPS | CONFIGURING IPv6 INTERFACES | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO | DIAGNOSTICS | NOTES |
|||||||||||||||||||||||||||||||||||||||||||