IP packet forwarding is the process of routing packets between network interfaces on one system. A packet arriving on one network interface and addressed to a host on a different network is forwarded to the appropriate interface.
In Solaris 10, IP Forwarding can be enabled or disabled using the routeadm & ifconfig commands as against the ndd commands in Solaris 9 and earlier. The advantage is the change dynamic and real-time and the change persist across reboot unlike the ndd command.
Enable/Disable IP Forwarding globally
To globally enable IP Forwarding in Solaris 10 use the routeadm command as follows:
solaris10# routeadm -e ipv4-forwarding
solaris10# routeadm -e ipv6-forwarding
The switches “-e” enables IP Forwarding.
To disable IP Forwarding
solaris10# routeadm -d ipv4-forwarding
solaris10# routeadm -d ipv6-forwarding
The switches “-d” enables IP Forwarding.
After the change run the following command for the changes to take effect.
solaris10# routeadm -u
Enable/Disable IP Forwarding per interface
To enable IP Forwarding on a specific interface (say ce0) using the ifconfig command
solaris10# ifconfig ce0 router
solaris10# ifconfig ce0 inet6 router
To disable IP Forwarding for an interface (say ce0)
solaris10# ifconfig ce0 -router
solaris10# ifconfig ce0 inet6 -router
3 thoughts on “Enable/Disable IP Forwarding in Solaris 10 without reboot”
Thank you for
very nice solution
There is a typo above:
>> The switches “-d” enables IP Forwarding.
>> -e option…
Enable the specified option. The effect is to prepare the associated services (svc:/network/ipv4-forwarding:default in the case of ipv4-forwarding) for enabling. By means of the routing-svcs variable, the routing daemons are specified to be enabled on subsequent boot or when routeadm -u is run.