Enable IP Routing On Solaris

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:

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:

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:

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:

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:

solaris10# routeadm -p ipv4-forwarding
solaris10# routeadm -p ipv6-forwarding

To get the IP forwarding configuration on Solaris 8:

solaris8# ndd /dev/ip ip_forwarding

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }