add route to a subnet - Solaris 2.6

WE are running Unix - Solaris 2.6, we create a subnet. In the windows enviroment we are able to add a static route by using
route add -p 172.16.10.0 mask 255.255.255.0 172.16.17.224, but when we add the route in Solaris as
route add -net 172.16.10.0 255.255.255.0 172.16.17.224, we receive an error message that says
add net 172.16.10.0: gateway 255.255.255.0: network is unreachable.

The 172.16.17.224 is a router used as the gateway to the subnets, however we are to ping 172.16.17.224 from Solaris.

Any idea why we cannot add a route to that subnet in Solaris 2.6?

I solved my problem by using
route add -net 172.16.16.0 172.16.17.224
leaving the subnet mask out and it work fine.

man route should have shown you the correct possition of your gateway and subnetmask :slight_smile:

Normaly you define your broacast as 0xffffff00 in solaris.

It's ok, always confusing :slight_smile:

Regs David

In my organisation, I have a private LAN (10.x.x.x) and a public LAN (172.x.x.x).
Machine in private LAN need to grep CAD license from public LAN.
I use the same method as what Cassy did on my Sun Machine and the settings is gone once the system reboots.

Any suggestion, how can I set the settings perm.

do we use the same methd on HPUX as well?

You can add a new startup script to /etc/rc2.d/ or /etc/rc3.d/ - see creating and using init.d/rc*.d startup scripts

I used to use some thing like
route add 10.99.101.0/24 10.99.101.1

On solaris you can add it in /etc/rc2.d/S72inetsvc or you can create a new script in the startup script directories