DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Installation and Upgrading

NetBSD Installation and Upgrading Have trouble getting NetBSD on your toaster?

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Talking ppp scripts help

has anyone got /etc/ppp scipts for options , peers etc so that i can connect to the net using pppd with my huawei usb-modem e620
tried the way netbsd hanbook says but i get message "uhmodem0:usba_requested:STALLED" and then i get "connect script failed"
cheers
Reply With Quote
  #2   (View Single Post)  
Old 15th May 2010
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Is this thread of any help?
Reply With Quote
  #3   (View Single Post)  
Old 16th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Default

cheers thats what im looking for
i'll cross my fingers and give it ago again
cheers dave
Reply With Quote
  #4   (View Single Post)  
Old 16th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Default

yeah done it all , i can connect my modem now but i cant get on the internet
it tells me "ping:cannot reslove "www.google.com"(host name lookup failure)"
sorry thats after i try to ping google.
its been racking my brain all day
any idea
cheers
Reply With Quote
  #5   (View Single Post)  
Old 16th May 2010
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

How do you know the connection with modem is established?

Try to find out your ISP's IP addressess of DNS servers, or try to use some publicly available and try to ping again. You put those addresses in /etc/resolv.conf file, if it is not there create one. See resolv.conf(5) for more.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #6   (View Single Post)  
Old 16th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Default

i've got a huawei usb-modem and when i run "pppd call vodafone" the blue light stays on intercating that i am connected to the net .i wouldnt have a clue about the ip's numbers, i,ve just used the same nameserver's in the resolv.conf as i do with my linux on my laptop
nameserver 202.81.67.132
nameserver 156.154.70.1
i'm with "vfinternet.au" which is vodafone australia
Reply With Quote
  #7   (View Single Post)  
Old 16th May 2010
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Hi wokko,

I'm guessing the blue light being on only means your modem is connected to the ISP modem, but the modem can't know if a proper PPP connection has been established (unless of course the remote side hangs up).

One place to look is in /var/log/messages for pppd(9)'s blow-by-blow account of things. Here's what mine looks like for a successful connection (I've munged the IP's):

Code:
May 16 11:11:44 throne pppd[289]: pppd 2.4.4 started by root, uid 0
May 16 11:12:13 throne pppd[289]: Serial connection established.
May 16 11:12:13 throne pppd[289]: Using interface ppp0
May 16 11:12:13 throne pppd[289]: Connect: ppp0 <--> /dev/modem
May 16 11:12:15 throne pppd[289]: CHAP authentication succeeded:
May 16 11:12:15 throne pppd[289]: CHAP authentication succeeded
May 16 11:12:15 throne pppd[289]: local  IP address xx.xx.xxx.xx
May 16 11:12:15 throne pppd[289]: remote IP address yyy.yy.yyy.yy
May 16 11:12:15 throne pppd[289]: primary   DNS address nnn.n.n.nnn
May 16 11:12:15 throne pppd[289]: secondary DNS address mmm.m.mmm.mmm
If you don't see something like that, there's a problem with your pppd configuration or chat script. In that case you might want to enable the "debug" parameter for pppd and check whatever debug log file is being used. Note the last 2 lines about DNS won't be there if you didn't use the "usepeerdns" parameter or your ISP doesn't support it. If usepeerdns does work, pppd will write those DNS addresses into /etc/ppp/resolv.conf. Note, this file is not the one in /etc that is used by DNS, you must take steps to use the results if you wish.

Another thing to check is your ppp0 interface when you think you might be up and running; as root, do:

Code:
# ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1524
        inet xx.xx.xxx.xx -> yyy.yy.yyy.yy netmask 0xff000000
        inet6 fe80::250:baff:fe26:b0a3%ppp0 ->  prefixlen 64 scopeid   0x3
And also check if packets are being routed through the interface:

Code:
# route show  -inet
Routing table

Internet:
Destination        Gateway            Flags
default            yyy.yy.yyy.yy      UG
loopback           127.0.0.1          UGR
localhost          127.0.0.1          UH
my.ip.name         xx.xx.xxx.xx       UH
Maybe you can provide your output to the above commands if it looks suspicious?

As s0xxx said, check your /etc/resolv.conf carefully. Another thing to check, though it's probably OK by default, is your /etc/nsswitch.conf file. There should be a line that looks something like

Code:
hosts:          files dns
in it. It could also say "dns files" on the right, just be sure dns is listed there.
Reply With Quote
  #8   (View Single Post)  
Old 17th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Default

i,ve been stuffing around with config files and now i cant get my modem to go LOL
when i run 'pppd call vodafone' i get now
"Serial connection established
Using interface ppp0
Connect: ppp0 <--> /dev/ttyU0
Modem hangup
connection terminated "

so im assuming it is dialing out
Reply With Quote
  #9   (View Single Post)  
Old 17th May 2010
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by wokko
i,ve been stuffing around with config files and now i cant get my modem to go LOL
when i run 'pppd call vodafone' i get now
"Serial connection established
Using interface ppp0
Connect: ppp0 <--> /dev/ttyU0
Modem hangup
connection terminated "
Looks to me like partial success, in that your chat script seems to be working. However, there's no indication of either CHAP or PAP authentication success.

So my first suggestion is to read everything relevant to authentication in the pppd(8) man page. Specifically how to authenticate yourself to the server. (The other way 'round is not needed which can be specified with the "noauth" option.)

Beyond that a few ideas:

* since you don't know if ISP supports only PAP or CHAP, so don't use either of "refuse-pap" or "refuse-chap".

* likewise make your pap-secrets and chap-secrets files the same ... symbolic link from one to the other will do.

* use the "user" parameter to pppd to tell it what to look up in the *-secrets file, e.g., "user yourispuserid@yourisp.au" or whatever it is.

* the *-secrets file needs to be owned by root, mode 600 and might contain something like this:

Code:
# Client                  Server          Secret
yourispuserid@yourisp.au  *               your_password
If you think you've done all this right and it still doesn't work, I strongly suggest enabling the "debug" option to pppd. This will let you look at all the authentication and connection negotiations going on.

Good luck, and let us know how it goes.
Reply With Quote
Old 18th May 2010
wokko wokko is offline
Port Guard
 
Join Date: May 2010
Posts: 26
Default SOLVED ppp script helps

thank IdOp for all your help
i came across this quick guide to seting it all up and yep heeeeeee it is all working
here is that guide :

Connecting to the Internet with UMTS on NetBSD

All you need is a laptop with cardbus slot (PCMCIA) and a datacard which is supported by NetBSD. The card will appear as an USB modem to the kernel. In my example I am using an Option N.V. MC3G (Vodafone Mobile Connect Card).

First of all you have to make sure the datacard is recognized by the kernel:

ohci0 at cardbus0 function 0: vendor 0x1045 product 0xc861 (rev. 0x10)
ohci0: OHCI version 1.0, legacy support
usb5 at ohci0: USB revision 1.0
uhub5 at usb5: vendor 0x1045 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub5: 2 ports with 2 removable, self powered
ubsa0 at uhub5 port 1
ubsa0: Vodafone Vodafone Mobile Connect Card - 3G, rev 2.00/0.00, addr 2
ucom0 at ubsa0 portno 0

ucom0 means we have successfully attached a serial adapter. ugen0 would mean the card is not yet supported. The device can be accessed through /dev/ttyU0. For a test, we add the following line to /etc/remote to communicate with the modem:

ucom0:dv=/dev/ttyU0:br#460800a=none:dc:

Then connect to the modem as root and try some AT commands:

# tip ucom0
connected
at
OK
atz
OK
ati
Manufacturer: Option Wireless Technology
Model: 129
Revision: 3.1.2 (Date: Mar 08 2004, Time: 11:54:30)

OK
at&v

&C: 1; &D: 2; &F: 0; E: 1; I: 0; L: 0; M: 0; Q: 0; V: 1; X: 4; Z: 0;
S0: 0; S3: 13; S4: 10; S5: 8; S6: 2; S7: 50; S8: 2; S9: 6; S10: 14;
S11: 95; +ICF: 3,3; +IFC: 2,2; +IPR: 115200; +DR: 0; +DS: 0,0,2048,6;
+CBST: 7,0,1; +CHSN: 0,0,0,0; +CSCS: "IRA"; +CSTA: 129; +CR: 0; +CRC: 0;
+CMEE: 0; +CGDCONT: (1,"IP","web.vodafone.de",,0,0)
,(2,"IP","web.vodafone.de",,1,0),(3,"IP","web.voda fone.de",,1,0);
+CGEQREQ: (1,4,0,0,0,0,1,1500,"0E0","0E0",3,0,0); +CGEQMIN: ; +CGQREQ: ;
+CGQMIN: ; +CGEREP: 0,0; +CGCLASS: "A"; +CGSMS: 3; +CSMS: 0; +CMGF: 0;
+CSCA: "",; +CSMP: ,,0,0; +CSDH: 0; +FCLASS: 0; +FDD: 0; +FAR: 0;
+FCL: 0; +FIT: 0,0; +ES: ,,; +ESA: 0,,,,0,0,255,; +CRLP: 61,61,48,6;
+CPIN: ,; +CGATT: 1; +CGACT: (1,0),(2,0),(3,0); +CPBS: "SM";
+CPMS: "SM","SM","SM"; +CNMI: 0,0,0,0,0; +FTS: 0; +FRS: 0; +FTH: 3;
+FRH: 3; +FTM: 96; +FRM: 96; +CCUG: 0,0,0; +CUSD: 0; +CFUN: 1; +CREG: 0;
+CGREG: 0; +COPS: 0,0,"",3; +COLP: 0; +CLIP: 0; +CLIR: 0; +CLVL: 2;
+CHLD: ; +CTFR: "",; +CCWA: 0,3,7; +CPOL: 0,2,"",0,0,0; +STPD: 0,;
+STGC: 0; +STCR: 0,"","",""; +STMS: 0,0; +STTONE: 0,1,500; +STRT: 0;
_OPOS: 0,0; _OPSYS: 0,0; _OSBM: 4; _OSQI: 0; _OGCVI: 0; _OSSYS: 0;
_OSEC: 0; _OLT: 0; _OLOOP: 0,0

OK

When you can talk to the modem as shown above you are nearly done. The card is fully supported and only some configuration is standing between you and a wireless internet connection. While at it you may want to disable the PIN on your SIM card. Otherwise you have to enter it every time the card is inserted or the system is rebooted. This can be a problem, because you can set the PIN only once. Afterwards this will produce an error. Type the following line while connected with the modem and replace "1234" with your valid PIN:

at+clck="sc",0,"1234"

If you do not want to disable the PIN, you have to enter it with the command at+cpin="1234" now. In both cases it should take only a few seconds before the blinking of both LEDs changes into a blinking of either the green (GPRS) or the blue one (UMTS) alone. The signal quality can be checked with at+csq:

at+csq
+CSQ: 15,0

OK

15 is a quite good value for UMTS. Possible levels are between 0 and 31. Now you should choose if you prefer UMTS or GPRS connections:
AT_OPSYS=0,2 GPRS only
AT_OPSYS=1,2 UMTS only
AT_OPSYS=2,2 Prefer GPRS
AT_OPSYS=3,2 Prefer UMTS

The provider is set with AT+CGDCONT, but it should already be preconfigured when receiving your SIM card. When missing, the configuration for Vodafone would be:

AT+CGDCONT=1,"IP","web.vodafone.de"

All the settings done above will be stored onto the SIM card, so we never have to bother about it again. Next step is the configuration of the internet access via PPP (point to point protocol)!

For the pppd daemon to work we have to provide a configuration and a chat script for our provider (Vodafone in this case). After activating pppd in /etc/rc.conf

ppp_peers="vodafone"

the daemon will read its options from /etc/ppp/peers/vodafone. The directories /etc/ppp and /etc/ppp/peers probably have to be created first. Then I am using a config file like this:

noauth
connect "/usr/sbin/chat -v -f /etc/ppp/peers/vodafone.chat"
/dev/ttyU0
460800
local
defaultroute
noipdefault
usepeerdns
novj
user "vodafone"
password "vodafone"
persist
maxfail 0

noauth
The provider doesn't have to authenticate itself.
connect
Specifies the chat-script to use when connecting (see below).
/dev/ttyU0
The modem device to use.
460800
Usual bps rate for UMTS.
local
Don't use modem control lines. Not required for UMTS.
defaultroute
Set the default route to this PPP connection, after it has been successfully established.
noipdefault
The provider supplies us with a local IP address during IPCP negotiation.
usepeerdns
Query the provider for DNS addresses and create /etc/ppp/resolv.conf with it.
novj
Diable Van Jacobsen header compression (Vodafone doesn't support it?).
user "vodafone"
User name for authentication.
password "vodafone"
Password for authentication.
persist
Always try to reconnect, when the connection fails or is lost.
maxfail 0
Never give up after failed connection attempts.

The chat-script (/etc/ppp/peers/vodafone.chat) is not much more than a simple dialing of *99***1#:

TIMEOUT 3
ECHO ON
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
'' '\rAT'
'' ATZ
TIMEOUT 6
OK 'ATDT*99***1#'

As soon as a connection to the provider was established successfully, we have a valid default route and a recent resolv.conf in /etc/ppp/. Now you could either use /etc/ppp/ip-up to copy resolv.conf or just create a link:

# cd /etc
# ln -s /etc/ppp/resolv.conf resolv.conf

That's all. Every time the system is booted you will be connected to the internet via UMTS, provided it is available. Now some fine tuning could be done. For example to delay pppd until /dev/ttyU0 is ready, or to allow LAN connections via DHCP, when you returned to your office.
Frank Wille, September 2008
Reply With Quote
Old 18th May 2010
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Glad to hear you got it working.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't load any scripts in ircII guitarscn General software and network 4 22nd November 2010 12:06 AM
DJB daemontools: compile and install scripts (OpenBSD) J65nko Guides 2 13th November 2009 10:57 AM
Executing web scripts : can't! erehwon OpenBSD General 3 3rd November 2009 10:02 PM
Windows scripts can't print drhowarddrfine Other OS 15 31st March 2009 08:53 AM
Periodic scripts for mail scripts stukov FreeBSD General 2 8th March 2009 07:51 PM


All times are GMT. The time now is 05:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick