Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Assigning IP addresses to modems in QNX4
Ref. No. QNX.000007942
Category(ies) Network, Configuration
Issue I have 10 modems, whenever somebody dials in I want to assign a different ip address to it. How can I do this?
Solution #!/bin/sh
tty=$(/bin/basename `/bin/tty`)
blah=${tty%%?}
ttyno=${tty##${blah}}
if echo $tty | /bin/fgrep mdm >/dev/null 2>&1; then
    exec /usr/ucb/pppd modem proxyarp $* quics:ppp${ttyno}
else
    echo "You must be on a modem device to run pppd"
    echo "(tty = $tty, ttyno = ${ttyno})"
    exec sleep 5
fi


As you can see, we do a 'tty' to get the login terminal, then parse the output to get the number that we want. After this, we add it to the ppp string and look in our /etc/hosts file for the ip address.