Difference between revisions of "Network configuration"

From Wiki :: openmamba
Jump to navigation Jump to search
(New page: To configure the network connection, after you've verified that is not already activated automatically, is relevant to know the type of network yo're using, due to the variety of mode of c...)
 
Line 32: Line 32:
 
==== Configure the WPA-PSK with static IP on openmamba ====
 
==== Configure the WPA-PSK with static IP on openmamba ====
  
 +
Assuming that your wireless device is perfectly working both with native driver or with [[ndiswrapper]].
  
Partiamo già dal presupposto che la vostra scheda pci wi-fi o pennino usb siano già attivi e funzionanti su Linux, sia con driver nativi sia con [[ndiswrapper]].
+
First of all we need the '''wpa_supplicant''' installed in the system. To do that use [[synaptic]] or the command:
Per ulteriori info su come configurare ndiswrapper si veda la pagina dedicata sul wiki.
 
 
 
Come prima cosa occorre avere il '''wpa_supplicant''' installato sul sistema. Per fare questo installare il pacchetto omonimo utilizzando [[synaptic]] oppure con il comando:
 
  
 
  sudo apt-get install wpa_supplicant
 
  sudo apt-get install wpa_supplicant
  
Ora con il comando
+
Now with the command
  
  wpa_passphrase "Tuoessid" "chiave_del_router"
+
  wpa_passphrase "youressid" "router_key"
  
otteniamo la chiave psk da inserire nel file ''/etc/wpa_supplicant.conf''.
+
we obtain the  psk key that we've to write in the  file ''/etc/wpa_supplicant.conf''.
  
Creiamo con un editor di testo, sempre da root, il file ''/etc/wpa_supplicant.conf'' e configuriamolo così:
+
With a text editor make, as root, the file ''/etc/wpa_supplicant.conf'' as following:
  
 
       ctrl_interface=/var/run/wpa_supplicant
 
       ctrl_interface=/var/run/wpa_supplicant
Line 52: Line 50:
  
 
       network={
 
       network={
       ssid="Tuoessid"
+
       ssid="youressid"
       #psk="chiave_nel_router"
+
       #psk="router-key"
       psk=chiave_psk_ottenuta_dal_comando_wpa_passphrase
+
       psk=psk_key_obtained_from_the_command_wpa_passphrase
 
       key_mgmt=WPA-PSK
 
       key_mgmt=WPA-PSK
 
       pairwise=TKIP
 
       pairwise=TKIP
Line 61: Line 59:
 
       }
 
       }
  
ora sempre da terminale, da root, completiamo la configurazione della scheda wlan0, nell'esempio il router ha come indirizzo ip 192.168.1.1, per prima cosa assegniamo un indirizzo IP alla scheda di rete, quindi:
+
now, from the console and as root, we can end the setup of the wlan0 device, for example the router has the IP address 192.168.1.1, then we give to the wireless device an IP address, for example 192.168.2.1:
  
 
       ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
 
       ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
  
ora agganciamo il router alla wlan0, quindi:
+
Now we link the router to wlan0:
  
 
       route add default gw 192.168.1.1
 
       route add default gw 192.168.1.1
  
infine lanciamo il wpa_supplicant e quindi di rimando il wpa con il comando:
+
and finally we launch the  wpa_supplicant and consequently the wpa with:
  
 
       wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd -B
 
       wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd -B
  
se tutto è andato bene, ora dovreste poter pingare il router con il comando:  
+
if is all ok, now you can ping the router with:  
 
       ping 192.168.1.1  
 
       ping 192.168.1.1  
  
e a questo punto dovreste anche poter navigare, inoltre il comando:  
+
and surf the internet; the command:  
 
       iwlist wlan0 scan  
 
       iwlist wlan0 scan  
  
dovrebbe restituirvi l'output completo con i parametri della connessione.
+
will return the output of all the conenction setup.
  
Per bloccare la connessione:  
+
To stop the connection you've to write:  
 
          
 
          
 
       ifconfig wlan0 down
 
       ifconfig wlan0 down
  
per riattivarla:  
+
to restart it:  
 
          
 
          
 
       ifconfig wlan0 up
 
       ifconfig wlan0 up
  
Infine opzionale, per evitare di dover scrivere nel terminale ogni volta i comandi citati, si può creare uno script che in auto lancerà la connessione, questo è il semplice script che uso io che ho chiamato ''wpa_start.sh'', per lanciarlo basta scrivere nel terminale, sempre da root:
+
Optionally to avoid the fact of writing all the command in the console every time, you can write a script that automatically launch the connection, that's the simply script that is used by me, and that is called ''wpa_start.sh''; to launch it just write  as root in the console:
 
        
 
        
 
         sh wpa_start.sh
 
         sh wpa_start.sh
  
Ricordarsi di renderlo eseguibile (io lo faccio con chmod a+x).
+
Remember to make in executable with chmod a+x wpa_start.sh.
Questo lo script:
+
That's the script:
  
 
         #!/bin/sh
 
         #!/bin/sh
Line 104: Line 102:
  
 
                                                                  
 
                                                                  
P.S.: attenti anche che i DNS del vostro provider siano stati scritti nel file /etc/resolv.conf, altrimenti in mancanza, riuscirete a pingare il router ma non ad entrare in internet.
+
Note: You'ce to check that the provider DNS are in the /etc/resolv.conf file, or you can ping the router but you can't surf the internet.
  
== Connessioni WAN ==
+
== WAN Connection ==
Rientrano in questa categoria le connessioni di rete tra due o più punti geograficamente distanti, quali:
+
Under that case there are the connections between 2 or more points geographically far away, as:
  
* collegamento ADSL attraverso un [[modem ADSL]] (con interfaccia USB o Ethernet verso il computer);
+
* ADSL connection via [[ADSL modem]] (with USB or Ethernet interface);
* collegamento Dial-Up attraverso una linea telefonica analogica utilizzando un [[modem analogico]] (velocità massima 56 Kbps);
+
* Dial-Up connection via analogic telephonic line using an [[analogic modem]] (maximum speed 56 Kbps);
* collegamento Dial-Up attraverso una linea ISDN utilizzando un [[modem ISDN]] (velocità massima 64 Kbps).
+
* ISDN Dial-Up connection with an [[ISDN modem]] (maximum speed 64 Kbps).
  
Queste tipologie di connessioni normalmente richiedono la configurazione, sul computer a cui è collegato il dispositivo WAN, del protocollo [[PPP]] (Point to Point Protocol). Questo protocollo dev'essere configurato in maniera diversa a seconda del tipo di collegamento.
+
All that type of connections requires the configuration on the computer to wich is connected the WAN device, of the [[PPP]] protocol (point to point protocol).
 +
That protocol has to be configured in different ways to reflect the connection type.
  
=== PPP attraverso linea telefonica ===
+
=== PPP via telephonic line ===
 
Questo tipo di collegamento può avvenire:
 
Questo tipo di collegamento può avvenire:
  
* collegando il portatile dotato di modem interno alla linea telefonica attraverso apposito connettore RJ-11;
+
* Connecting the computer with the internal modem to the telephonic line using the RJ-11 plug;
* collegando il modem analogico o ISDN al computer attraverso un cavo seriale RS-232 ed alla linea telefonica attraverso cavo con connettore RJ-11.
+
* Connecting an analogic modem or and ISDN modem to the computer serial port (RS232) and to the phone line via the RJ-11 plug.
  
Istruzioni per la configurazione:
+
Setup instruction:
# avvia il programma '''KPPP''' che si trova in '''Menù openmamba''' -> '''Internet'''
+
# start '''KPPP''' from the '''openmamba Menu''' -> '''Internet'''
# fai click su  '''Configura'''
+
# click on '''Setup'''
# fai click sul tab '''Modem'''
+
# click on tab '''Modem'''
# se non è disponibile un modem crealo utilizzando il pulsante '''Nuovo...''' altrimenti salta il prossimo punto
+
# if a modem is not available create a new one using the button '''New...''' else go to the next point
# seleziona il ''Dispositivo del modem'': tipicamente un modem interno viene identificato dal device '''/dev/modem''', mentre un modem seriale da '''/dev/ttyS0'''
+
# Select the ''Modem device'': normally the internal modem is identified by  '''/dev/modem''', where the external one is '''/dev/ttyS0'''
# fai click sul tab '''Modem'''
+
# click on tab '''Modem'''
# disattiva la casella corrispondente a ''Attendi il segnale di linea prima di comporre il numero''
+
# uncheck the box ''Wait line tone before compose''
# effettua il test del modem facendo click su '''Interroga Modem'''
+
# test the modem clicking on '''Query Modem'''
# se il test ha avuto successo premi OK per uscire dalla finestra di configurazione del modem, altrimenti prova con altri dispositivi o verifica che il driver per il modem interno sia disponibile e funzionante attraverso [[slmodemd]] o [[hsfmodem]]
+
# If the test is successful click OK to exit, else try other devices or verify that the internal modem driver is available and working with [[slmodemd]] or [[hsfmodem]]
# fai click sul tab '''Account''' e su '''Nuovo...''', seleziona '''Configurazione manuale''', assegna il nome del tuo provider alla connessione ed inserisci il numero di telefono
+
# Click on tab '''Account''' and '''Now...''', select '''Manual setup''', write your provider name and the phone number
# la configurazione è stata completata. Premi OK per uscire dalla finestra di configurazione
+
# The setup is ended. Press OK to exit the setup window
# inserisci ''nome utente'' e ''password'' che ti sono stati assegnati dal provider e premi il pulsante '''Connetti''' per avviare la connessione.
+
# insert ''username'' and ''password'' of your internet connection and press '''Connect''' to start the connection
  
 
=== PPP over Ethernet ===
 
=== PPP over Ethernet ===
Per questo tipo di collegamento occorre utilizzare il programma '''tkpppoe''' disponibile su '''Menù openmamba''' -> '''Internet''' -> '''ADSL'''.
+
For that connection you've to use '''tkpppoe''', from the '''openmamba menu''' -> '''Internet''' -> '''ADSL'''.
Creare una nuova connessione specificando in particolare ''nome utente'' e ''password'' ed utilizzare i pulsanti '''Start''' e '''Stop''' per attivare e disattivare la connessione.
+
Make a new connection writing '''username''' and '''password''' and click on '''Start''' or '''Stop''' to activate and deactivate the connection.
  
 
=== PPP over ATM ===
 
=== PPP over ATM ===
Questo protocollo viene normalmente utilizzato quando ci si connette attraverso un '''modem ADSL''' con porta '''USB'''.
+
That protocol is normally used when you connect via a '''ADSL modem''' with USB port.
In questo caso occorre aprire il file  
+
In that case edit the file  
 
  /etc/ppp/options-atm
 
  /etc/ppp/options-atm
  
ed inserire il proprio utente, esempio:
+
and write your user info, for example:
  
 
<pre>
 
<pre>
Line 162: Line 161:
 
</pre>
 
</pre>
  
Inoltre occorre aggiungere le informazioni di autenticazione nei files
+
Edit also the files  
  
 
  /etc/ppp/pap-secrets
 
  /etc/ppp/pap-secrets
  
e
+
and
  
 
  /etc/ppp/chap-secrets
 
  /etc/ppp/chap-secrets
  
ad esempio:
+
with autentication info, for example:
  
 
<pre>
 
<pre>
Line 178: Line 177:
 
</pre>
 
</pre>
  
Per attivare la connessione andare su '''Menù openmamba''' -> '''Internet''' -> '''ADSL''' -> '''pppoatm start'''; per disattivarla selezionare invece '''pppoatm stop'''.
+
To activate the connection go in '''Openmamba menu''' -> '''Internet''' -> '''ADSL''' -> '''pppoatm start'''; to deactivate it use  '''pppoatm stop'''.
  
== Diagnostica dei problemi di rete ==
+
== Network problem diagnosys ==
Se dopo aver seguito le istruzioni non riesci ad accedere alla rete, ad esempio utilizzando il browser '''konqueror''' e/o '''firefox''', consulta la pagina di [[Problemi di rete dopo configurazione|diagnostica dei problemi di rete dopo la configurazione]].
+
If, after you've followed the instruction, the network don't works, for example using the browser '''konqueror''' and/or '''firefox''', go to the page [[Network problems after the setup|Network problems diagnosys after the setup]].

Revision as of 21:20, 3 June 2008

To configure the network connection, after you've verified that is not already activated automatically, is relevant to know the type of network yo're using, due to the variety of mode of connection offered by the ISPs.(Internet Service Providers).

LAN Connection

In that type the computer is connected to a local net regardless of the fact that in that network there is or not an internet access point.

Under that category there are:

  • Network access via Ethernet cable or Wireless to a local network where there is a DHCP server that provide a default gateway to exit on the Internet (for example FastWeb);
  • A connection to a ADSL router that provide a Ethernet o Wireless interface and that provide internally the support to the protocoll PPP over Ethernet;
  • A generic connection to a local network una qualunque connessione ad una rete locale di computer isolate from other networks.

Ethernet

The network interfaces detected by the system are preconfigured to obtain an IP address from a DHCP server. That configuration is enough as often as not of the situation. To configure a static IP address, the default gateway, the routing table and other network settings, click on openmamba control center, the choose network, and Configure. On the window that shows up you can choose every network interface and configure it. (tipically the network interface is called eth0)

Wireless

To configure the Wireless network the system has to know:

  • The network identify code (ESSID)
  • A pre-shared key (PSK)

To input that information click on Openmamba control center, choose Network, then click on Configure. Select the Wireless interface (tipically wlan0, wifi0 or ath0) and input the correct ESSID and WEP Key values.

Note: the WPA and WPA2 autentication mode is not actually supported by the system, but with the wpa_supplicant tool is possible to activate a connection of that type via command line.

At the moment is advised to configure the Wireless card to do a WEP autentication and wait that the PSK and PSK2 support become available in openmamba

Due to the big variety of devices available, is possible that the wireless device is not recognized by the system. In that case is possible to use the ndiswrapper and the Microsoft Windows driver; the configuration il possible via the Openmamba menu -> Settings -> Windows wireless drivers. Major info are available looking the list available on the ndiswrapper site.

Configure the WPA-PSK with static IP on openmamba

Assuming that your wireless device is perfectly working both with native driver or with ndiswrapper.

First of all we need the wpa_supplicant installed in the system. To do that use synaptic or the command:

sudo apt-get install wpa_supplicant

Now with the command

wpa_passphrase "youressid" "router_key"

we obtain the psk key that we've to write in the file /etc/wpa_supplicant.conf.

With a text editor make, as root, the file /etc/wpa_supplicant.conf as following:

      ctrl_interface=/var/run/wpa_supplicant
      ap_scan=1
      network={
      ssid="youressid"
      #psk="router-key"
      psk=psk_key_obtained_from_the_command_wpa_passphrase
      key_mgmt=WPA-PSK
      pairwise=TKIP
      group=TKIP
      proto=WPA
      }

now, from the console and as root, we can end the setup of the wlan0 device, for example the router has the IP address 192.168.1.1, then we give to the wireless device an IP address, for example 192.168.2.1:

      ifconfig wlan0 192.168.1.2 netmask 255.255.255.0

Now we link the router to wlan0:

      route add default gw 192.168.1.1

and finally we launch the wpa_supplicant and consequently the wpa with:

      wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd -B

if is all ok, now you can ping the router with:

      ping 192.168.1.1 

and surf the internet; the command:

      iwlist wlan0 scan 

will return the output of all the conenction setup.

To stop the connection you've to write:

      ifconfig wlan0 down

to restart it:

      ifconfig wlan0 up

Optionally to avoid the fact of writing all the command in the console every time, you can write a script that automatically launch the connection, that's the simply script that is used by me, and that is called wpa_start.sh; to launch it just write as root in the console:

       sh wpa_start.sh

Remember to make in executable with chmod a+x wpa_start.sh. That's the script:

       #!/bin/sh
       ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
       route add default gw 192.168.1.1
       wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd -B 


Note: You'ce to check that the provider DNS are in the /etc/resolv.conf file, or you can ping the router but you can't surf the internet.

WAN Connection

Under that case there are the connections between 2 or more points geographically far away, as:

  • ADSL connection via ADSL modem (with USB or Ethernet interface);
  • Dial-Up connection via analogic telephonic line using an analogic modem (maximum speed 56 Kbps);
  • ISDN Dial-Up connection with an ISDN modem (maximum speed 64 Kbps).

All that type of connections requires the configuration on the computer to wich is connected the WAN device, of the PPP protocol (point to point protocol). That protocol has to be configured in different ways to reflect the connection type.

PPP via telephonic line

Questo tipo di collegamento può avvenire:

  • Connecting the computer with the internal modem to the telephonic line using the RJ-11 plug;
  • Connecting an analogic modem or and ISDN modem to the computer serial port (RS232) and to the phone line via the RJ-11 plug.

Setup instruction:

  1. start KPPP from the openmamba Menu -> Internet
  2. click on Setup
  3. click on tab Modem
  4. if a modem is not available create a new one using the button New... else go to the next point
  5. Select the Modem device: normally the internal modem is identified by /dev/modem, where the external one is /dev/ttyS0
  6. click on tab Modem
  7. uncheck the box Wait line tone before compose
  8. test the modem clicking on Query Modem
  9. If the test is successful click OK to exit, else try other devices or verify that the internal modem driver is available and working with slmodemd or hsfmodem
  10. Click on tab Account and Now..., select Manual setup, write your provider name and the phone number
  11. The setup is ended. Press OK to exit the setup window
  12. insert username and password of your internet connection and press Connect to start the connection

PPP over Ethernet

For that connection you've to use tkpppoe, from the openmamba menu -> Internet -> ADSL. Make a new connection writing username and password and click on Start or Stop to activate and deactivate the connection.

PPP over ATM

That protocol is normally used when you connect via a ADSL modem with USB port. In that case edit the file

/etc/ppp/options-atm

and write your user info, for example:

user "silvan@myprovider.it"
plugin pppoatm.so 8.35
logfile /var/log/pppd.log
noipdefault
usepeerdns
defaultroute
persist
noauth
nopcomp
noccp
novj
holdoff 5
maxfail 25

Edit also the files

/etc/ppp/pap-secrets

and

/etc/ppp/chap-secrets

with autentication info, for example:

# Secrets for authentication using PAP
# client        server  secret                  IP addresses
"silvan@myprovider.it"         *       "mypassword"                    *

To activate the connection go in Openmamba menu -> Internet -> ADSL -> pppoatm start; to deactivate it use pppoatm stop.

Network problem diagnosys

If, after you've followed the instruction, the network don't works, for example using the browser konqueror and/or firefox, go to the page Network problems diagnosys after the setup.