maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   pppd on maemo help (https://talk.maemo.org/showthread.php?t=96718)

Sohil876 2016-05-06 11:59

pppd on maemo help
 
So ive been trying to use pppd in n900 over bluetooth dun (with kp53) to connect to internet via nokia 2690 phone with instructions from Matans thread and googling a lot of sites. I finally made it work after getting the right chat script and it was working just fine... until for some reason while conected via pppd my phone froze and had to restart it. After that it never worked fully again, fully because i can ping/access any site via ip but in not able to visit domains, also im unable to ping my peer it results in 100% packet loss, i can ping nameservers successfully. I think its probably a dns or route problem, what do you guys think.

My chat script:
Code:

ABORT  'BUSY'
ABORT  'NO CARRIER'
ABORT  'ERROR'
TIMEOUT 5
REPORT  CONNECT
''      AT
OK      AT&C1
OK      ATZ
OK      AT+CGDCONT=1,"IP","Tata.Docomo.Internet"
OK      ATDT*99#
TIMEOUT 30
CONNECT    ''

Options file:
Code:

#dump
#460800
#115200
#nocrtscts
#defaultroute
#replacedefaultroute
usepeerdns
noauth
lock
#noip
noipdefault
ipcp-accept-local
ipcp-accept-remote
debug
nodetach
#persist
#passive
#default-asyncmap
#asyncmap 0
noaccomp
nobsdcomp
nodeflate
nopcomp
novj
noccp
novjccomp
refuse-chap
user "blank"
password "blank"

Also is this the default /etc/resolv.conf on n900? this is my current one:
Code:

nameserver 127.0.0.1
nameserver ::1

pppd log:
Code:

abort on (BUSY)
abort on (NO CARRIER)
abort on (ERROR)
timeout set to 5 seconds
report (CONNECT)
send (AT^M)
expect (OK)
AT^M^M
OK
 -- got it

send (AT+CGDCONT=1,"IP","Tata.Docomo.Internet"^M)
expect (OK)
^M
AT+CGDCONT=1,"IP","Tata.Docomo.Internet"^M^M
OK
 -- got it

send (ATDT*99#^M)
timeout set to 30 seconds
expect (CONNECT)
^M
ATDT*99#^M^M
CONNECT
 -- got it

send (^M)
chat:  May 06 16:59:52 CONNECT
Script /usr/sbin/chat -s -S -v -f /etc/ppp/chat/gprs.chat finished (pid 1884), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/rfcomm2
rcvd [LCP ConfReq id=0x0 <auth pap> <mru 1500> <asyncmap 0xa0000>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x6fe66ce6>]
sent [LCP ConfAck id=0x0 <auth pap> <mru 1500> <asyncmap 0xa0000>]
rcvd [LCP ConfRej id=0x1 <magic 0x6fe66ce6>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0>]
sent [PAP AuthReq id=0x1 user="blank" password=<hidden>]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x0 <addr 10.6.6.6>]
sent [IPCP ConfAck id=0x0 <addr 10.6.6.6>]
rcvd [IPCP ConfNak id=0x1 <addr 100.99.179.75> <ms-dns1 103.8.45.5> <ms-dns2 103.8.46.5>]
sent [IPCP ConfReq id=0x2 <addr 100.99.179.75> <ms-dns1 103.8.45.5> <ms-dns2 103.8.46.5>]
rcvd [IPCP ConfReq id=0x0 <addr 10.6.6.6>]
sent [IPCP ConfAck id=0x0 <addr 10.6.6.6>]
rcvd [IPCP ConfAck id=0x2 <addr 100.99.179.75> <ms-dns1 103.8.45.5> <ms-dns2 103.8.46.5>]
local  IP address 100.99.179.75
remote IP address 10.6.6.6
primary  DNS address 103.8.45.5
secondary DNS address 103.8.46.5
Terminating on signal 2
Connect time 2.5 minutes.
Sent 1092 bytes, received 0 bytes.
sent [LCP TermReq id=0x3 "User request"]
rcvd [LCP TermAck id=0x3]
Connection terminated.

ifconfig ppp0 output:
Code:

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:100.99.179.75  P-t-P:10.6.6.6  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:64 (64.0 B)  TX bytes:64 (64.0 B)

Heres what route -n shows after pppd connects:
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
10.6.6.6        0.0.0.0        255.255.255.255 UH    0      0        0 ppp0

And heres what route -n gives with defaultroute and replacedefaultroute enabled in options file:

Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
10.6.6.6        0.0.0.0        255.255.255.255 UH    0      0        0 ppp0
0.0.0.0        0.0.0.0        0.0.0.0 U    0      0        0 ppp0


sicelo 2016-05-06 15:55

Re: pppd on maemo help
 
there is no gateway set for the packets
i don't have 'replacedefaultroute' in my working config, but have 'nodefaultroute' :) It works on my config

Sohil876 2016-05-06 20:10

Re: pppd on maemo help
 
tried that already makes no diffrence, the strange thing is i can only ping/access sites ip's not domains(dns problem?), also im unable to ping my peer. Can you post /etc/resolv.conf , default one from your phone?

sicelo 2016-05-06 20:15

Re: pppd on maemo help
 
my /etc/resolv.conf is same as yours.
add the gateway manually then.

Code:

ip route add default dev ppp0
as for pinging the peer .. it may be blocking ICMP replies?

sicelo 2016-05-06 20:29

Re: pppd on maemo help
 
ah .. so you can ping remote IPs? (i had not noticed that before)
your route is fine.

actually i've just tested on mine, and yes, my previous comment regarding there being no gateway was incorrect. your route is correct.

create a /var/run/resolv.conf file and add your desired DNS server, e.g. 8.8.8.8. You may have to stop and start dnsmasq afterwards

Sohil876 2016-05-07 22:28

Re: pppd on maemo help
 
Tried, still doesnt work, i no longer have any idea what is the problem here, i even built newer pppd from debian jessi, same problem. Is there any other way to use dun without pppd or rpppoe? wvdial does not works on fremantles glibc, wvstream gives some gettext assertion fail.

sicelo 2016-05-08 05:43

Re: pppd on maemo help
 
you can still ping remote IP addresses?
attach the contents of these files:
Code:

/etc/resolv.conf
/etc/dnsmasq.conf
/var/run/resolv.conf


Sohil876 2016-05-08 11:51

Re: pppd on maemo help
 
yes i can ping remote ips. /etc/resolv.conf is in first post, i dont have /var/run/resolv.conf, ive tried copying /etc/resolv.conf to /var/run/ , coping /etc/ppp/resolv.conf to /var/run/, creating a resolv.conf with custom dns in /var/run/ with 8.8.8.8 as nameservers and restarting dnsmasq after that, that didnt work.
My /etc/dnsmasq.conf

Code:

domain-needed
bogus-priv
resolv-file=/var/run/resolv.conf
resolv-file=/var/run/resolv.conf.wlan0
resolv-file=/var/run/resolv.conf.ppp0
resolv-file=/var/run/resolv.conf.lo
resolv-file=/var/run/resolv.conf.gprs

Also i have a script /etc/ppp/ip-up which creates /var/run/resolv.conf.ppp0 on pppd connection with correct dns.

sicelo 2016-05-08 12:10

Re: pppd on maemo help
 
You seem to have the correct files everywhere, and pinging remote IPs says you are online.

Maybe your provider enforces their own DNS servers (some do). Try to copy the dns servers that pppd receives (103.8.45.5/103.8.45.6), and put them in either /var/run/resolv.conf or /var/run/resolv.conf.ppp0

Also, just test if you can resolve domain names using dig or nslookup, e.g.
Code:

dig @8.8.8.8 example.com

Sohil876 2016-05-08 13:45

Re: pppd on maemo help
 
It finally worked! adding dns manually to /var/run/resolv.conf didnt work so i added this:
Code:

echo nameserver $DNS1 > /var/run/resolv.conf
echo nameserver $DNS2 >> /var/run/resolv.conf

in my /etc/ppp/ip-up script, and it seems to have done it. Its strange though, i never needed this, just:
Code:

echo nameserver $DNS1 > /var/run/resolv.conf.ppp0
echo nameserver $DNS2 >> /var/run/resolv.conf.ppp0

in /etc/ppp/ip-up script worked fine before, i now for some reason need entries for both resolv.conf and resolv.conf.ppp0 in /etc/ppp/ip-up for it to work. Anyways it works now and thats all that matters, thanks a lot for all the help :) . Theres one more thing id like to ask, is there anyway to exit/kill pppd when my modem for some reason hangsup or disconnects? (happens frequently, problem in my other phones bt) because my n900 freezes when that happens so i cant kill pppd myself, like some error recovery in chatscript or something else killing pppd when modem hangsup, because pppd apparently continues without noticing that modem has hung up and so i have no choice but to restart n900.
EDIT:-
Adding :
Code:

local
nocrtscts
lcp-echo-interval 30
lcp-echo-failure 3

to /etc/ppp/options file seems to solve that last problem as well! after peer hangsup, my n900 no longer freezes and pppd automatically terminates as it should :)


All times are GMT. The time now is 09:33.

vBulletin® Version 3.8.8