Adding new Route

Hi,
I am trying to add route command in SunOS machine but it is not successful :

route add -host 10.31.251.47 -gateway 10.31.251.0 -interface ce0

this command fails with an error "lo0:1: bad value"

I want to add a route to 10.31.251.47 that picks 10.31.251.0 as the gateway via the interface ce0. Could you help and guide me how this can be done?

Thanks

=================
-bash-3.00# cat /etc/defaultrouter
10.31.251.1

===================

-bash-3.00# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
10.30.159.208 10.30.136.1 UG 1 0
10.31.245.0 10.30.136.1 UG 1 0
10.31.244.0 10.30.136.1 UG 1 0
10.30.254.0 10.30.136.1 UG 1 0
10.77.74.0 10.30.136.1 UG 1 0
10.31.133.0 10.30.136.1 UG 1 0
10.31.132.0 10.30.136.1 UG 1 2
10.31.135.0 10.30.136.1 UG 1 0
10.31.128.0 10.30.136.1 UG 1 0
10.31.130.0 10.30.136.1 UG 1 0
10.22.133.0 10.30.136.1 UG 1 0
204.4.114.0 10.30.136.1 UG 1 0
10.30.136.0 10.30.136.42 U 1 20 ce1
10.22.129.0 10.30.136.1 UG 1 0
10.119.0.0 10.30.136.1 UG 1 40
10.31.136.0 10.30.136.1 UG 1 4
10.22.131.0 10.30.136.1 UG 1 0
10.119.2.0 10.30.136.1 UG 1 0
10.153.206.0 10.30.136.1 UG 1 0
172.31.0.0 172.31.194.125 U 1 0 ce2
224.0.0.0 10.31.251.47 U 1 0 ce0
default 10.31.251.1 UG 1 0
127.0.0.1 127.0.0.1 UH 4 108 lo0

==================

-bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.31.251.47 netmask ff000000 broadcast 10.255.255.255
ether 0:14:4f:69:40:b0
ce1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 10.30.136.42 netmask ffffff00 broadcast 10.30.136.255
ether 0:14:4f:69:40:b1
ce2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
inet 172.31.194.125 netmask ffff0000 broadcast 172.31.255.255
ether 0:14:4f:69:40:b2
-bash-3.00#

Try this and get back with the results:

route add -host 10.31.251.47 10.31.251.0

otherwise:

route add net 10.31.251.47 10.31.251.0

Good luck :wink: