X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fppp9k;h=e40a7e86d0571a36bbe5838a1253e28620cb23ba;hp=c1a67129e7759bf75b6db6b12b6b2dba0d8e7aad;hb=a4fec27ddb426c9259d4b3f10e741228d3ce3f83;hpb=06077158fd33f002c6fba29d2eb04cba3bf770e2 diff --git a/bin/ppp9k b/bin/ppp9k index c1a6712..e40a7e8 100755 --- a/bin/ppp9k +++ b/bin/ppp9k @@ -1,6 +1,17 @@ #!/bin/sh # # $Id$ +# written by Jan Kratochvil +# +# Note to users of: +# Linux running INSIDE VMWare (e.g. on Win32 machine) +# and internet connection through local ethernet card: +# You MUST enable masquerading (NAT) for your Communicator's IP address! +# iptables -t nat -F +# iptables -t nat -A POSTROUTING --source 192.168.90.1 -j MASQUERADE +# (replace 192.168.90.1 by your $NOKIA9K setting below, if you change it) +# - problem investigation by courtesy of Hussain Akbar + # IP address for N9K, "192.168.90.1" if not provided (either here or from # some ~/.profile etc.) @@ -38,17 +49,24 @@ PORT="${PORT:-ttyS1}" if [ "${PORT#*/}" = "$PORT" ];then PORT="/dev/$PORT";fi NOKIABAUD="${NOKIABAUD:-19200}" +# Some rules for the chat script: +# 9000i starts with: ATZ, AT&F (the need for TIMEOUT 2, "-OK^M^J-AT&F") +# 9110 starts with: AT&F +# user can have global custom initialization string (need for one "OK^M^J") +# user can have connection custom initialization string (need for one "OK^M^J") + (trap "" HUP while [ '!' -f "$pid" ];do sleep 1;done me="`cat "$pid"`" while :;do pppd "$PORT" "$NOKIABAUD" modem lock -crtscts xonxoff :$IP asyncmap 0 ms-dns "$NS" \ - connect 'chat -v \ - "TIMEOUT" "86400" \ - "ATZ" "OK^M^J" \ - "AT&F" "OK^M^JOK^M^JOK^M^J" \ - "TIMEOUT" "20" \ - "ATD" "CONNECT^M^J" \ + connect 'chat -v \ + "TIMEOUT" "86400" \ + "AT" "\c" \ + "TIMEOUT" "2" \ + "&F-OK^M^J-AT&F" "OK^M^JOK^M^JOK^M^J" \ + "TIMEOUT" "20" \ + "ATD" "CONNECT^M^J" \ ' \ -ccp nodefaultroute proxyarp lcp-echo-interval 30 lcp-echo-failure 2 lcp-max-configure 30 -detach \ -chap noauth "$@" &