I am restarting io-net so I can configure (2) NICs and start IPFilter. If I type out the commands individually it works great, but if I put it in a script 9 times out of 10 it will fail. I have tried sleep commands in the script, but it doesn’t seem to help. I posted the whole script, but it seems to fail on the io-net command, since the next lines are ifconfig and it errors “ifconfig: socket: No such file or directory” When this happens the rest of the script fails, from lack of interfaces. Again if I type these out it works everytime…
This is what I am trying to do:
echo “Restarting io-net…”
slay -f io-net
sleep 2
io-net -d ne2000 -d el900 -p tcpip forward
sleep 2
ps -A | grep io-net
echo “done.”
echo “Bringing up interfaces…”
ifconfig en0 up
ifconfig en1 up
sleep 1
ifconfig -a
sleep 1
echo “done.”
echo “Assigning IP addresses…”
netmanager
echo “done.”
echo “Starting IPFilter…”
mount -T io-net /lib/dll/nfm-ipfilter.so
sleep 1
ipnat -FC -f/etc/ipfd.conf
sleep 1
ipf -f/etc/ipfw.conf
ipf -y
echo “done.”
Oops, I forgot you are running 6.1, maybe that is not supported in
6.1. But if_up should wait until there is an IP configured on an
interface (that’s what it designed to), so “always return true”
sounds no good if you “if_up en0” before even ifconfig it.
Here is what is says on a 6.2 installation.
$ use if_up
if_up [-ap] [-r retries] [-s seconds] interface…
Options:
-p Only wait until specified interfaces are present. Default is
to wait until interfaces are both present and configured.
-a Wait until all specified interfaces are present / configured.
Default is to wait until a single interface is present /
configured.
-r retries Number of times to walk interface list. Default is 5.
-s seconds Wait this number of seconds before re-walking interface list.
Default is 1.
But - from another PC, I can only ping to the IP address of en0, not en1.
If I don’t config en0, ie: io-net -di82544 -ptcpip if=en1:192.168.0.2
then I can ping to en1.
What is the proper way to config multiple interfaces on the same NIC card to run TCPIP?
I don’t think QNX supports to have two IP addresses on the same subnet. Maybe you can try to use 192.168.0.X for one and 192.168.1.X for the other interface.
You have to have too separate network for the two subnet, not just playing with different IPs. Assuming you have the QNX box (server A) wired to both network, and you have server B wired on subnet one, server C wired on subnet two. server B should be able to ping one interface on server A, and server C should be able to ping the other interface on server A.