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 172.24.17.38, subnet mask of ff.ff.ff.c0, and default gateway of 172.24.17.60. 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:
127.000.000.001 localhost localhost.my.domain
172.24.17.38 nodeName # Address on customer network
172.24.17.32 customer1
172.24.17.19 customer2
172.24.17.60 RouterAddress #Default Gateway
255.255.255.192 SubnetMask
Here is the code from netstart:
/usr/ucb/Socklet nodeName &
/usr/ucb/socket_so.100
/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
en3: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
inet 172.24.17.38 netmask ffffffc0 broadcast 172.24.17.63
netstat -r
Routing tables
Destination Gateway Flags Refs Use Interface
Route Tree for Protocol Family 2:
(root node) =>
default 172.24.17.60 UG 0 0 en3
localhost 127.0.0.1 UH 1 2 lo0
172.24.17 172.24.17.38 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?