Setting IP Interface Properties

This section explains how to use the ipadm command to set selected IP interface
properties.

IP interfaces, like datalinks, have properties that you can customize for your specific
network environment. For each interface, two sets of properties exist, one set for
the IPv4 and the other set for the IPv6 protocols. Some properties, such
as MTU, are common to both datalinks and IP interfaces. Thus, you can
have one MTU value for a datalink and a different MTU value
for the interface configured over that link. Further, you can have different MTU
values that apply to IPv4 and IPv6 packets that traverse that IP interface.

Three ipadm subcommands are used to set IP interface properties:

The ipadm show-ifprop -ppropertyinterface subcommand displays the properties of an IP interface and their current values. If you do not use the -pproperty option, then all the properties of the IP interface are listed. If you do not specify an IP interface, then all the properties of all IP interfaces are listed.

The ipadm set-ifprop -pproperty=valueinterface subcommand assigns a value to the IP interface's property.

The ipadm reset-ifprop -ppropertyinterface subcommand resets the specific property to its default values.

Enabling Packet Forwarding

In a network, a host can receive data packets that are destined
for another host system. By enabling packet forwarding in the receiving local system, that
system can forward the data packet to the destination host. By default, IP
forwarding is disabled.

Packet forwarding is managed by a property that can be set on
both IP interfaces and on the TCP/IP protocol. If you want to be
selective in how packets are forwarded, then you enable packet forwarding on the
IP interface. For example, you might have a system that has multiple NICs.
Some NICs are connected to the external network, while other NICs are connected
to the private network. You would therefore enable packet forwarding only on some
of the interfaces, rather than on all interfaces.

Note - The forwarding property of either IP interfaces or protocols is not exclusive. You
can set the property for the interface and the protocol at the same
time. For example, you could enable packet forwarding globally on the protocol, and
then customize packet forwarding for each IP interface on the system. Thus, although
enabled globally, packet forwarding can still be selective for the system.

To enable packet forwarding on the IP interface, use the following command:

# ipadm set-ifprop forwarding=on [-m protocol-version] interface

where protocol-version is either IPv4 or IPv6. You must issue the command separately
for IPv4 and IPv6 packets.

The following is an example of how you might enable only IPv4
packet forwarding on your system: