How do I create a static IP route?

On a 2 Node QNX4, TCP/IP system, with 2 network printer I have the following
IP configuration
Host1 172.31.25.140
Host2 172.31.25.141
Printer1 172.31.25.145
All above pieces use subnetmask 255.255.255.128
The 2nd printer is on a different subnetmask (customer wants to use one of
his existing printers)
Printer2 172.31.25.3
I tried to add a route with the following command:
route -v add -net 172.31.25.3 172.31.25.140
Via netstat -rn I can see the new created route, but I still can’t print to
printer2.
When I ping 172.31.25.3, ping gets stuck and doesn’t return anything.

Thanks for any help, NANCY

Nancy Appelhagen wrote:

On a 2 Node QNX4, TCP/IP system, with 2 network printer I have the following
IP configuration
Host1 172.31.25.140
Host2 172.31.25.141
Printer1 172.31.25.145
All above pieces use subnetmask 255.255.255.128
The 2nd printer is on a different subnetmask (customer wants to use one of
his existing printers)
Printer2 172.31.25.3
I tried to add a route with the following command:
route -v add -net 172.31.25.3 172.31.25.140

If 172.31.25.3 is a host address, then you shouldn’t use ‘-net’ here,
since that would mean you’re defining it as a network address.

You should try to find out what subnet the printer is on. The convention
is then to find a router (gateway) which is reachable in both subnets,
and then define a route to the printer via that router. I.e.

route add 172.31.25.3

If you don’t have such a router, you can use an alias trick: you can
give 172.31.25.140 a second IP address (using the ‘alias’ option of
ifconfig) which is in the other subnet, thus effectively turning it into
a router.

good luck,
rick

Via netstat -rn I can see the new created route, but I still can’t print to
printer2.
When I ping 172.31.25.3, ping gets stuck and doesn’t return anything.

Thanks for any help, NANCY