View topic - Basic TCP/IP Startup On QNX4

Basic TCP/IP Startup On QNX4

For the old QNX2 and QNX4 RTOS

Basic TCP/IP Startup On QNX4

Postby tanstaafl » Tue Apr 04, 2006 8:16 pm

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?
tanstaafl
Active Member
 
Posts: 12
Joined: Wed Nov 10, 2004 5:50 pm
Location: eastern north america

Postby tanstaafl » Tue Apr 04, 2006 10:19 pm

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 172.0.0.0 172.24.17.60

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?
tanstaafl
Active Member
 
Posts: 12
Joined: Wed Nov 10, 2004 5:50 pm
Location: eastern north america

Postby mario » Wed Apr 05, 2006 4:06 am

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 ;-)
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby tanstaafl » Wed Apr 05, 2006 12:35 pm

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.
tanstaafl
Active Member
 
Posts: 12
Joined: Wed Nov 10, 2004 5:50 pm
Location: eastern north america

Postby kbeaucha » Thu May 03, 2007 3:02 pm

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 xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the IP address of your gateway. I'll be doing more testing next week.
kbeaucha
Active Member
 
Posts: 16
Joined: Wed May 03, 2006 5:40 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 2 guests