[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Un pò OT :Raspberry + Raspbian + fastweb



On 02/08/2017 09:14, Giancarlo Martini wrote:
> E' la procedura giusta o salto qualche punto?
> Grazie

Ti allego una procedura che ho usato tempo fa con successo..

Non si trattava di fastweb, ma penso cambi poco.
Fai le sostituzioni che sono richieste

ispapn => l'apn di fastweb
ispname => fastweb

:)

ciao
N


-- 
+---------------------+
| Linux User  #554252 |
+---------------------+
First we need to create so called chat script that will communicate directly to your modem hardware and configure things like
access point name (APN), timeouts and calling number using AT commands. I will create file named "ispname" inside
/etc/chatscripts/ directory to hold my chat script (replace "ispname" with your ISP name).

cat /etc/chatscripts/ispname

TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'ERROR'
ABORT 'NO CARRIER'
'' 'ATZ'
'OK' 'ATE1'
'OK' 'AT+CGDCONT=1,"IP","ispapn","0.0.0.0",0,0'
'OK' 'ATDT*99#'
'CONNECT' '\c'


You should replace "ispapn" with your ISP access point name (APN.)
My ISP is using PAP authentication so I must add user name and password provided by my ISP at the end of my /etc/ppp/papsecrets
file.
sudo nano /etc/ppp/pap-secrets

If your Internet service provider is using CHAP authentication do the same but use /etc/ppp/chap-secrets file. Also we must
decide on remote name identification string that will be used in the next steps to instruct pppd to use right pap or chap
credentials. I will use string "ispname" here. So here's what I have placed at the end of my /etc/ppp/pap-secrets file (place your
user name, password and string of your choice here instead of my "ispusername", "isppassword" and "ispname"):
"ispusername" "ispname" "isppassword"
If your ISP isn't using authentication and you don't need to provide name and password to connect to Internet you can skip this
step altogether.
As a third step we must create so called peers file that will be used by pppd to dial chat script created in the first step using
credentials stored in the second step. I will call my peers file "ispname" and place it into /etc/ppp/peers directory:

sudo nano /etc/ppp/peers/ispname

hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/ispname"
debug
/dev/ttyUSB0
115200
defaultroute
replacedefaultroute
noipdefault
usepeerdns
crtscts
lock
local
# Redial and interval
persist
holdoff 5
# No compression
novj
novjccomp
nopcomp
nodeflate
# PAP authentication
user "ispusername"
remotename ispname
refuse-chap
refuse-mschap
refuse-mschap-v2
refuse-eap
# LCP echo messages settings
lcp-echo-failure 4
lcp-echo-interval 65535


Uso di DNS alternativi al provider
due to usepeerdns option my example provided here is requesting DNS information from my ISP. To use your own DNS info, for
example Google public DNS or OpenDNS, you will create file inside /etc/ppp/resolv directory. For example to use Google public
DNS servers I would create /etc/ppp/resolv/google file and place following code inside:
nameserver 8.8.8.8
nameserver 8.8.4.4

Then you would need to remove "usepeerdns" line from your peers file and add something like:
ipparam google
where google is the name of your file inside /etc/ppp/resolv directory ("google" in my case). I recommend configuring manual
DNS settings later when you are sure that everything works with "usepeerdns".

Avvio della connessione
This is basic configuration to get you online.
To dial your connection you would use sudo pon ispname
and to disconnect you would use sudo poff ispname
(where "ispname" is you peers file name.)

To be able to dial without sudo you need to add your self to "dialout" group: sudo adduser $USER dialout

Further you might want to create interface for your pppd connection so you could control your GSM mobile broadband connection
using "ifup" and "ifdown" commands and/or dial automatically when your PC boot.

cat/etc/network/interfaces file
auto ppp0
iface ppp0 inet ppp
pre-up sleep 10
provider ispname

Reply to: