IP routing or IP forwarding is the process of routing packets between the network interfaces on a system with routing capabilities. While routing is usually the job of a network router, a server running on any recent version of UNIX can perform this action as well.
The IP forwarding functionality is usually disabled by default, and it should never be enabled unless required. A server with IP forwarding functionality could potentially be hacked to access unauthorised remote networks.
In this article, we will see how we can enable IP forwarding in Solaris.
In Solaris 9 and earlier, the ndd
command could be used to enable or disable IP forwarding. From Solaris 10 onwards, the routeadm
and ifconfig
commands are used.
On Solaris 10, enable IP forwarding by running the routeadm command as follows:
1 2 3 |
solaris10# routeadm -e ipv4-forwarding solaris10# routeadm -e ipv6-forwarding solaris10# routeadm -u |
On Solaris 8 or 9, enable IP forwarding by running the ndd command as follows:
1 2 |
solaris8# ndd -set /dev/ip ip_forwarding 1 solaris8# ndd -set /dev/ip6 ip6_forwarding 1 |
To disable IP forwarding, run the following commands on Solaris 10:
1 2 3 |
solaris10# routeadm -d ipv4-forwarding solaris10# routeadm -d ipv6-forwarding solaris10# routeadm -u |
Run the following to disable IP forwarding in Solaris 8 or 9:
1 2 |
solaris8# ndd -set /dev/ip ip_forwarding 0 solaris8# ndd -set /dev/ip6 ip6_forwarding 0 |
To get the IP forwarding configuration on Solaris 10:
1 2 |
solaris10# routeadm -p ipv4-forwarding solaris10# routeadm -p ipv6-forwarding |
To get the IP forwarding configuration on Solaris 8:
1 |
solaris8# ndd /dev/ip ip_forwarding |