Enable/disabl IP-forwarding on Solaris 10

In Soloaris 10 routeadm & ifconfig command can be used instead of the ndd command (sol9) to set IP forwarding.

note: the interface name are depends on the system.

1. Enable\Disable ip_forwarding (ipv4 and ipv6)

--> # routeadm -e ipv4-forwarding
--> # routeadm -d ipv4-forwarding

--> # routeadm -e ipv6-forwarding
--> # routeadm -d ipv6-forwarding

Note:
-e for enable and -d for disable the interface

2. Enable\Disable ip-forwarding on specific interface (ipv4 and ipv6)

--> # ifconfig pcn1 router
--> # ifconfig pcn1 inet4 router

Disable

--> # ifconfig pcn1 -router
--> # ifconfig pcn1 inet4 -router

Note:

ifconfig router and -router place in the /etc/hostname.pcn1 file, along with other ifconfig commands when interface initially configured.

3. Any routeadm configuration to take effect on the running system, use the below command:

--> # routeadm -u

-----------------------

Enable\Disable ip_forwarding on previous version (sol9,8)

--> # ndd -set /dev/ip ip_forwarding 1
--> # ndd -set /dev/ip ip4_forwarding 1

Disable

--> # ndd -set /dev/ip ip_fotwarding 0
--> # ndd -set /dev/ip ip4_fotwarding 0



No comments:

Post a Comment