route table

EN1: gateway1:
EN2: gateway2:

We want to connect en1 to through gateway1 and
connect en2 to through gateway2,below is my config:

route delete
route add -net -interface
route add -net -interface

route add //A
route add //B

but it’s very strange that only one channel can be created,for example if i
set as above i can ping to,but i can’t ping to,if i exchange A and B,i can ping to,but i can’t ping to,i don’t know the reason,please help me,thanks.

I’m a little unsure of whether this is the problem, but the leading bit of your first byte (10) is 0. According to, this means you are using a Class A network. While you should be able to subnet this, I’m not sure if you are doing it properly. Maybe if you use the “MASK” argument with route, specifying the subnet mask it will work better?

we use the same subnet mask,Does qnx has special strategy for route table?Which should I change?

Your commands above do not have a subnet mask listed. By default, a class C network would have the mask, but you are not using a class C network. You are using a class A network, which by default has the mask I’m not 100% sure about this, but if you changed your IP’s to 192.168.. I think the problem would disappear.

Do you mean that I should change as below?
route add
route add

Do you mean that I should change as below?
Well no, if anything you would use as the mask, but I don’t think that will work either.

I can’t find documentation that shows the route command using a mask parameter.
I think you would have to setup the mask with ifconfig.

Let me try again, you say you are trying to connect different IP addresses through different gateways.
I think the problem is that both of those IP addresses are on the same class A network. Let me make
an analogy that might help.

Let’s say you want to connect to through gateway 1, and through gateway 2.
Unsurprisingly, you can only create on channel, because as far as the underlying software is concerned,
both of these IP are on the same class C network. Does that help?

I don’t know how to fix this if you insist on using a class A network, but there no doubt is a way.

help me,please!!!

/sbin/ifconfig -a
netstat -rn

maschoen,Do you mean that I should setup only one channel of one gateway for IP AND
route add //A
route add //B

route add
route add
route add
route add

but i think and should belong to different network using netmask,Is it right?

To the first question, no.
To the second question, no they can belong to different sub-nets, but they are part of the same net.
Why don’t you take noc’s advice and post the results.

please see the bmp attached,sorry i can’t simulate the two gateway at home

Looks like your routing table is all messed up.

Your QNX box has the netmask of Do the two target machines and also use the netmask ?

If all of them are using, here is the command to add the routes:

route add -net 10.50.23 -netmask
route add -net 10.50.22 -netmask

That should solve your problem.

noc,i do just as you say,both of the two gatway is binded to en1(i use netstat -rn to look the interface),normally it should be binded to en1 and en2,it is the same as i set before,why?

it’s strange that if I change the 10.x.x.x to another network,it can work,maschoen, it’s not that i insist on using A network,indeed, it 's customer’s request.Is it possible for the request?

oh,my god,I found it’s ok on complete QNX,by the way I make my own small system by using my build file,Do I lost some config?I have copy all file of /etc on QNX that is OK to my system,but it’s no use,Which should i change?please give me some advice.

in my build i use “io-net -drtl -ptcpip” and in qnx i find it is “io-net -p tcpip”,should I set the option of io-net?

I found the reason,the broadcast of en1 and en2 is “”,but they should be “” and “”,I don’t know why?

Aggggggggghem! Because you are using a CLASS A network.

maschoen,why in intact QNX it’s OK,I mean that I use QNX CD boot,it’s OK.