IP Address

How can I programmatically change a host IP address? Can the IP address only be set on boot up?


I would take a look at the socket library.


you could issue a system() function with a call to ifconfig

however the new IP is only available till the next reboot, to change the IP permanently it depends on which QNX version you are using:

for QNX 6 you should have a look at /etc/net.cfg and the docs of phlip and netmanager
for QNX 4 the IP can be set with an ifconfig cmd at startup (start looking at /etc/config/sysinit.nodeid), so you would have to modify the startup script