OK,
I’m finally figuring out some things. The problems:
- Changing to use the large stack (and DHCP) by editing
/etc/system/enum/include/net
leaves me with an incorrect routing table default entry
WHY?
- There are some timing issues WRT starting qnet.
My solutions:
1.a. To use large tcp stack, edit /etc/system/enum/include/net
to read:
all
set(IONET_CMD, io-net -ptcpip)
b. in /etc/rc.d/rc.local
if_up en0 # wait till en0 has an address
route change default 192.168.1.1 # point to cable router.
2. It’s a good idea to wait for en0 to be configured before mounting
qnet. So do it after an if_up en0 in rc.local as in:
if_up en0
mount -Tio-net /lib/dll/npm-qnet.so
It seems to me that the need to do a route change is a bug somewhere in dhcp.client.
I’m also confused about the example use of if_up dnix in the help section describing dhcp.client
io-net -dne2000 -pttcpip
waitfor /dev/socket
dhcp.client &
if_up ndix
I think that this should read:
io-net -dne2000 -pttcpip
on -w /dev/socket -W30 dhcp.client
if_up en0
since waitfor appears to be a shell function (OK, it probably is
OK for an example boot script)
I don’t think that dnix is an RTP interface - and the if_up command
would only be needed if something else follows in the script. So it’s a poor example of if_up usage.
Previously, David Hawley wrote in qdn.public.qnxrtp.installation:
Previously, Xiaodan Tang wrote in qdn.public.qnxrtp.installation:
Xiaodan Tang <> xtang@qnx.com> > wrote:
David Hawley <> David.L.Hawley@computer.org> > wrote:
I still cannot get routing to work by simply editing:
/etc/system/enum/include/net
to:
all
set(IONET_CMD, io-net -ptcpip)
Oh, forgot this. So what is the problem ? You can’t ping
some IP on local network? you can ping IP over internet?
You can’t resolve a name?
I can ping the local net fine, routing is not working to the outside.
Here’s netstat -rn:
netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
default 192.168.1.1 UG 0 2 - lo0
127.0.0.1 127.0.0.1 UH 2 135 - lo0
192.168.1 192.168.1.100 U 0 3 - en0
192.168.1.100 192.168.1.100 UH 0 4 - lo0
As you can see the default has interface lo0 instead of en0. Why is
this? (Here I have removed my rc.local and am using the net file above).
netstat -nr should give you a clue, and at least put “route add …”
in rc.local should solve any “routing problem”.
It seems to me that dhcp should do this properly. If I modify rc.local, I want it to be pretty generic.
Also, in rc.local you suggest using if_up before mounting qnet. I’m being somewhat dense here - what interface should I wait for in if_up?
Thanks,
Dave
-xtang
So as a hack, I’m using the following rc.local
slay -f io-net fs-nfs2 inetd dhcp.client
io-net -del900 -ptcpip
sleep 2
dhcp.client -h shadow -i en0 -d
sleep 5
mount -Tio-net /lib/dll/npm-qnet.so
fs-nfs2
/usr/sbin/inetd
If I do not use the sleeps, then dhcp.client runs ready and /net
ends up with an entry that contains non-asci characters.
instead of “sleep 2”, “on -w /dev/socket -W 30” will be more reliable,
instead of “sleep 5”, if_up could be used.
On a second box with the small stack, I just mount qnet in rc.local and end up with 2 entries in net for that name on shadow. ie:
/home/dlh> ls /net
dave dave. shadow
on dave, I end up with dave. and shadow entries.
The entry “dave” and “shadow” showes this 2 box have same domain,
the entry “dave.” showes a machine called “dave” with no (NULL) domain.
\
David L. Hawley D.L. Hawley and Associates
–
David L. Hawley D.L. Hawley and Associates