Basic TCP/IP Startup On QNX4

I know this is a question that could be answered by just about anybody who runs a PC with a TCP/IP stack, but since it’s a QNX4 machine, I thought it best to ask where OS-specific quirks wouldn’t affect the answers.

One of our customers has a QNX4.25 box running FTP and TELNET. He wants his box to have an IP address of, subnet mask of ff.ff.ff.c0, and default gateway of I was told that subnet masks could be put into the hosts file, and the relevant system calls would look there for aliases in commands. With that in mind, I put the requested subnet mask into hosts and changed netstart. Needless to say (or I wouldn’t be asking), I cannot ping addresses on the other side of the gateway unless I specifically add a route to the desired network or host that points to (what I thought would be) the default gateway.

Here are the active lines in /etc/hosts: localhost nodeName # Address on customer network customer1 customer2 RouterAddress #Default Gateway SubnetMask

Here is the code from netstart:
/usr/ucb/Socklet nodeName &
/usr/ucb/ifconfig en3 nodeName SubnetMask up
/usr/ucb/ifconfig lo0 localhost up
/usr/ucb/route add default RouterAddress -netmask SubnetMask
on -d -t/dev/con6 /usr/ucb/rpc_so.100
on -d -t/dev/con6 /usr/ucb/inetd -d &

When I run ifconfig on en3 and check the routing tables, this is what I get:

ifconfig en3

inet netmask ffffffc0 broadcast

netstat -r

Routing tables
Destination Gateway Flags Refs Use Interface

Route Tree for Protocol Family 2:
(root node) =>
default UG 0 0 en3
localhost UH 1 2 lo0
172.24.17 U 1 160 en3
(root node)

As U can see, the ‘SubnetMask’ alias works in the IFCONFIG command, but whether I use the alias in the ROUTE command or specify the subnet mask explicitly, I cannot get this working. I am not a network guy; unfortunately for me, I have been unable to resolve this. Can anybody help me out?

Uh …

… In working with the customer just now, I found that all packets were going through the QNX4 machine; the default route wasn’t working. I had to explicitly add a route so that all packets go the the router:
/usr/ucb/route add

NOW at least incoming packets get routed correctly … but I don’t know why. Could this be an artifact of using Socklet instead of Socket?

No Socklet is just the TCP/IP stack without support for NFS.

Socket is from TCP/IP 4.25, if possible an upgrade to 5.0 would be nice :wink:

Thanks, Mario!

Unfortunately, the customer wants me off his machine now that he can reach the QNX4 box from the other side of the router (even though the QNX4 box can’t reach him). I’ll have to set up a box and a router here in the plant to test this out, but that will take a while to line up. I’ll post another reply when I do.

I wanted to add a default route and couldn’t find the instructions in the QNX 4 documentation. By playing around I found that “route” seems to accept this:

route add default

where is the IP address of your gateway. I’ll be doing more testing next week.