In this Solaris release, IP forwarding is enabled or disabled by using the routeadm command or the ifconfig commands instead of setting the following tunable parameters with the ndd command:
ip_forwarding
ip6_forwarding
xxx_forwarding
Using the routeadm command and the ifconfig command instead of the ndd command to set IP forwarding provides the following advantages:
All settings are persistent across reboots
The new ifconfig router and -router commands can be placed in the /etc/hostname.interface files, along with other ifconfig commands that are run when the interface is initially configured.
To enable IPv4 or IPv6 packet forwarding on all interfaces of a system, you would use the following commands:
# routeadm -e ipv4-forwarding |
# routeadm -e ipv6-forwarding |
To disable IPv4 or IPv6 packet forwarding on all interfaces of a system, you would use the following commands:
# routeadm -d ipv4-forwarding |
# routeadm -d ipv6-forwarding |
In previous Solaris releases, you would enable IPv4 or IPv6 packet forwarding on all interfaces of a system as follows:
# ndd -set /dev/ip ip_forwarding 1 |
# ndd -set /dev/ip ip6_forwarding 1 |
In previous Solaris releases, you would disable IPv4 or IPv6 packet forwarding on all interfaces of a system as follows:
# ndd -set /dev/ip ip_forwarding 0 |
# ndd -set /dev/ip ip6_forwarding 0 |
If you want to enable IP forwarding on a specific IPv4 interface or IPv6 interface, you would use syntax similar to the following for your interface. The bge0 interface is used an as example.
# ifconfig bge0 router |
# ifconfig bge0 inet6 router |
If you want to disable IP forwarding on a specific IPv4 interface or IPv6 interface, you would use syntax similar to the following for your interface. The bge0 interface is used an as example.
# ifconfig bge0 -router |
# ifconfig bge0 inet6 -router |
Previously, IP forwarding was enabled on a specific interface as follows:
# ndd -set /dev/ip bge0:ip_forwarding 1 |
# ndd -set /dev/ip bge0:ip_forwarding 1 |
Previously, IP forwarding on a specific interface was disabled as follows:
# ndd -set /dev/ip ip_forwarding 0 |
# ndd -set /dev/ip ip6_forwarding 0 |
If you want any of the preceding routeadm settings to take effect on the running system, use the following command:
# routeadm -u |
For more information, see routeadm(1M) and ifconfig(1M).