Setting up 2 Ethernet controllers on a single QNX node

Hello

We are setting up QNX 4.25 on a Parvus 4200 PC/104 CPU, which has 2 RTL8139 Ethernet controllers. We would like to use both ports on this node for communication, but we are unable to configure both ports.

We defined two IP addresses, one for each port, and started the driver for both as well (settings given by the ‘nettrap -v’ command):
Net &
Net.rtl -pfc00 -i9 -I0 -l1 &
Net.rtl -pf800 -i9 -I1 -l2 &

We then call netstart, which is configured as follows:

#!/bin/sh

/bin/sleep 2

export SOCK=$NODE
/bin/slay -f Socket Socklet;
/bin/prefix -D /dev/console >/dev/null 2>&1;
/bin/prefix -A /dev/console=/dev/con1;

# start up Socket: assume hostnames are defined as 'node#'
# Note:  if not using NFS, use Socklet instead
/usr/ucb/Socket mynode1 &
/usr/ucb/Socket mynode2 &

# Note:  assuming ethernet interface on logical LAN 1
/usr/ucb/ifconfig en1 mynode1 up 
/usr/ucb/ifconfig en2 mynode2 up
/usr/ucb/ifconfig lo0 localhost up 
/usr/bin/syslogd

# Note:  to act as an NFS server, uncomment the next line
# /etc/nfsstart

# Note:  to act as a TCP/IP server, uncomment the next line
/usr/ucb/inetd

When calling netstart, we get the following message:
Socket: Unable to attach name: /qnx/socket
ifconfig: ioctl (SIOCAIFADDR): File exists

After that only the first port works, but not the second.

Would anyone have some suggestions for my problem?

Thanks in advance.

Socket is only one for all interfaces (eg: /usr/ucb/Socket mynode &)
problem is not in Socket, but rather in lower level

start only one socket and post here output of
netinfo -l
ifconfig en1
ifconfig en2

OK, after starting just 1 socket, here is:

the output of netinfo -l:

Total Number Of Net Driver Slots: 2

Driver Slot 0: Driver Pid 50 Logical Net 1 Network Card: Ethernet/
rtl : RealTek 8139 Ethernet Controller
Vendor ID … 0x10ec
Device ID … 0x8139
Subsystem ID … 0x8139
Subsystem Vendor ID … 0x10ec
Revision … 0x2000010
Physical Node ID … 00E0C7 074795
Media Rate … 0Mb/s
Mtu … 1514
Hardware Interrupt … 9

Total Packets Txd OK ............. 0
Total Packets Txd Bad ............ 0
Tx Collision Errors .............. 0
Tx Collision Errors (aborted) .... 0
Carrier Sense Lost on Tx ......... 0
FIFO Underruns During Tx ......... 0
Tx deferred ...................... 0
Out of Window Collisions ......... 0

Total Packets Rxd OK ............. 0
Total Rx Errors .................. 0
FIFO Overruns During Rx .......... 0
Alignment errors ................. 0
CRC errors ....................... 0

Driver Slot 1: Driver Pid 53 Logical Net 2 Network Card: Ethernet/
rtl : RealTek 8139 Ethernet Controller
Vendor ID … 0x10ec
Device ID … 0x8139
Subsystem ID … 0x8139
Subsystem Vendor ID … 0x10ec
Revision … 0x2000010
Physical Node ID … 00E0C7 074796
Media Rate … 100Mb/s
Mtu … 1514
Hardware Interrupt … 9

Total Packets Txd OK ............. 0
Total Packets Txd Bad ............ 0
Tx Collision Errors .............. 0
Tx Collision Errors (aborted) .... 0
Carrier Sense Lost on Tx ......... 0
FIFO Underruns During Tx ......... 0
Tx deferred ...................... 0
Out of Window Collisions ......... 0

Total Packets Rxd OK ............. 1202
Total Rx Errors .................. 0
FIFO Overruns During Rx .......... 0
Alignment errors ................. 0
CRC errors ....................... 0

the output of ifconfig en1:

en1: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
inet 131.91.108.169 netmask ffff0000 broadcast 131.91.255.255


finally, the output of ifconfig en2

en2: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
inet 131.91.108.169 netmask ffff0000 broadcast 131.91.255.255

Thank you

ok, it looks like both cards are up and running. The card for en1 looks like it was unable to negotiate a media rate with the switch. Perhaps it wasn’t plugged in, or some other problem there.

At this point you should be to configure the ip and give them a try.

Rick…

en1 reported no media rate simply because it was not plugged to a network.
I have gone step by step through the list of commands in the netstart file, and everything goes well until the call for the ifconfig for the second port:

ifconfig en1 auv4 up
(OK)
ifconfig en2 auv4 up
fconfig: ioctl (SIOCAIFADDR): File exists

At this point, the first port will communicate successfully, but not the second one.
How do I need to configure the second port?

gab.

They both have the same IP addresses, can’t do that.

OK, can’t do that.
I defined 2 IP addresses, mynode1 and mynode2, in /etc/hosts. Now, how do I start Socket with these 2 IP addresses? There is an option for multiple interfaces, ‘-d forward’. Is this a good use for it?
Socket -d forward mynode1 mynode2 &

When I do that, the system does not complain.
Now I need to call ifconfig for each interface, en1 and en2. However, when doing so, I run into the same problems I had before:
ifconfig en1 mynode1 up
(OK)
ifconfig en2 mynode2 up
ifconfig: ioctl (SIOCAIFADDR): File exists

Any idea what am I doing wrong this time?

Gabriel.

Socket doesn’t care how much interface you have. I’m not sure what -d is for but you don’t need it ;-)

The IP address needs to be on different segment? Are they? Can you post the content of /etc/hosts

Mario:
I had both IPs as part of the same LAN (131.91.108.169, and 131.91.108.170). That would be the problem?
So are you saying I need to specifiy IPs associated with 2 different LANs? Say, the one I’m currently using (131.91.108.x), and a second one, say 192.168.x.x, for the second node?

Here is the content of my hosts file:

127.0.0.1 localhost localhost.my.domain
131.91.108.169 auv4 node1
131.91.108.170 auv5 node2
131.91.109.26 mini1 mini1.seatech.fau.edu
131.91.109.27 mini2 mini2.seatech.fau.edu
131.91.108.167 auv2 auv2.seatech.fau.edu
131.91.108.168 auv3 auv3.seatech.fau.edu
209.226.137.75 quics quics.qnx.com

[quote=“ggabriel”]
Mario:
I had both IPs as part of the same LAN (131.91.108.169, and 131.91.108.170). That would be the problem?
So are you saying I need to specifiy IPs associated with 2 different LANs? Say, the one I’m currently using (131.91.108.x), and a second one, say 192.168.x.x, for the second node?
/quote]

Yes that’s what I’m saying. You didn’t mention what the netmask was but 131.91.109.x for example should work if the mask is 255.255.255.0.

Maybe you can get around this by using IP alias, I never tried it myself.

Ok, here we go. I think this needs further explanation.

Socket is TCP-IP manager in QNX4, it has nothing to do with network cards, it only extends functionality provided by Net.
It has an optional argument hostname (eg: /usr/ucb/Socket node1 &), where hostname is a virtual name for whole machine (doesn’t matter how many network cards computer have).

ifconfig is a configuration tool, which allows to configure some properties of network card and TCP-IP. It has an mandatory argument interface and many optional arguments. For example, you can assign IP address to an interface and enable it (eg: ifconfig en1 node1_en1 up; ifconfig en2 node1_en2 up) where node1_en1 and node1_en2 are defined in /etc/hosts file (eg:
131.91.108.169 node1_en1
131.91.108.170 node1_en2
)

Some standards:
All interfaces on a machine must have unique IP address for each interface.
Two interfaces on different machines cannot have same IP address if they are on same LAN (LAN in the meaning they can transfer packet between them via TCP-IP family protocols).

Ok, back to your problem ggabriel. I think you just need few make-ups in your config files:

/etc/netstart

[code]/usr/ucb/Socket mynode1 &

/usr/ucb/ifconfig en1 mynode1_en1 up
/usr/ucb/ifconfig en2 mynode1_en2 up[/code]
/etc/hosts

131.91.108.169 mynode1_en1 mynode1 # also assigning mynode1 alias name to 131.91.108.169 address 131.91.108.170 mynode1_en2

mezek, are you sure this is going to work, both ip are on the same segment?

Why not? I do not know of anything that could be wrong there.

Ok, there is a general problem with outgoing connections, but that problem will appear even on different netmask or different segment.

If you use default route, the outgoing connection will not connect if the default route interface doesnt work. Manual magic work with metric can switch to use other outgoing default route (dunno in qnx4, but works in other OSes).

This is the only thing that you can possibly have problem with.

Hi guys.
Thanks for all your help. I did run into problems when setting 2 IPs with the same segment, that’s when I got that error message:
ifconfig: ioctl (SIOCAIFADDR): File exists.
I’ve now set up the system to 2 different segments, one for our LAN, and the other one for a private network (192.168.x.x), and that seems to work ok.
At this point my QNX machine can communicate with either side, I now need to set up the QNX machine so that computers on the LAN can talk to the computer on the private network. I’m just starting to read about it, but I understand so far I need to start the routed daemon, and maybe do some more from there.
Gabriel.

Ooops,
Sorry Mario, You were right.

The IPs must have different (inet & netmask).
eg:
(131.91.108.169 & ffff0000 = 131.91.0.0) != (131.92.108.169 & ffff0000 = 131.92.0.0)

Where do I find the socklet manager? It´s not in the /usr/ucb directory. I have QNX Neutrino.

Best regards, Tom

Socket and Socklet are QNX4 application only. The tcpip stack under QNX6 consists of a share object called npm-tcpip.so or npm-ttcpip.so (tt is for tiny). There is also a IP6 version

QNX Neutrino is also known as QNX 6.
and this thread is talking about QNX 4. so …