Enable Extar Ethernet Interface on Solaris 10

First check what are all the interface currently in active, by using below command.


---> # ifconfig -a



Enable\Disable Network interface pcn1. you can change the interface name according to your machine.

--> # ifconfig pcn1 plumb
--> # ifconfig pcn1 unplumb


Now we can add IP to interface pcn1


--> # fconfig pcn1 192.168.2.20 netmask 255.255.255.0 broadcast 192.168.2.255

Then bring up the interface 


--> # ifconfig pcn1 up


Now additional interface is ready. but make this interface persistence on next reboot, so we need to configure some more files.


Create a new file in /etc with this format hostname.interface. add the interface IP and subnet



--> # vi /etc/hostname.pcn1
-->  192.168.2.20 netmask 255.255.255.0


And also edit and add these files /etc/inet/hosts and /etc/inet/ipnodes


--> # vi /etc/inet/hosts
-->  192.168.2.20   naachi



--> # vi /etc/inet/ipnodes
-->  192.168.2.20   naachi


note: naachi is hostname for 192.168.2.20





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