View previous topic :: View next topic |
Author |
Message |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Tue Oct 30, 2007 3:45 pm Post subject: /etc/conf.d/net e EESID contenenti il carattere "-" |
|
|
In /etc/conf.d/net posso impostare delle configurazioni particolari per ogni essid, tipo
Code: | config_mioessid=("192.168.1.5") |
Se pero' ho un essid contenente il carattere "-" tipo mioessid-123 ottengo un errore quando lancio l'init script, e ovviamente la configurazione per questo essid non funziona. Ad esempio se uso questa riga:
Code: | config_mioessid-123=("192.168.1.5") |
ottengo questo errore:
Code: | /etc/conf.d/net: line 43: syntax error near unexpected token `"192.168.1.5"'
/etc/conf.d/net: line 43: `mioessid_Alice-123=("192.168.1.5")' |
Per vari motivi non posso modificare questo essid, quindi mi servirebbe davvero una soluzione... _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Tue Oct 30, 2007 4:08 pm Post subject: |
|
|
Basta sostituire "-" con "_" |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Tue Oct 30, 2007 4:14 pm Post subject: |
|
|
MeMyselfAndI wrote: | Basta sostituire "-" con "_" |
Certo, potrei anche sostituire "mioessid-123" con "porchetta", ma, come detto sopra non posso modificare l'essid dell AP... _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Tue Oct 30, 2007 4:15 pm Post subject: |
|
|
nel file di conf intendo... mioessid-123 diventa mioessid_123 |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Tue Oct 30, 2007 4:17 pm Post subject: |
|
|
MeMyselfAndI wrote: | nel file di conf intendo... mioessid-123 diventa mioessid_123 |
e lo riconosce comunque?? _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Tue Oct 30, 2007 4:18 pm Post subject: |
|
|
e non fai prima a provare ? |
|
Back to top |
|
 |
Kernel78 Moderator

Joined: 24 Jun 2005 Posts: 3654
|
Posted: Tue Oct 30, 2007 6:12 pm Post subject: |
|
|
topper_harley wrote: | MeMyselfAndI wrote: | Basta sostituire "-" con "_" |
Certo, potrei anche sostituire "mioessid-123" con "porchetta", ma, come detto sopra non posso modificare l'essid dell AP... |
 _________________ Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza. (Larry Wall).
Prima di postare un file togli i commenti con Code: | grep -vE '(^[[:space:]]*($|(#|!|;|//)))' |
|
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Tue Oct 30, 2007 6:28 pm Post subject: |
|
|
MeMyselfAndI wrote: | e non fai prima a provare ? |
nulla da fare... eppure deve esserci un modo per dargli in pasto quel carattere... _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
djinnZ Advocate


Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Tue Oct 30, 2007 7:08 pm Post subject: |
|
|
Non ricordo perchè il "-" non è ben visto, ma hai letto bene la nota in conf.d/wireless.example? Mi sa che è come per lo spazio (anche se un "\-" mi pare strano). _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist  |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Tue Oct 30, 2007 8:59 pm Post subject: |
|
|
djinnZ wrote: | Non ricordo perchè il "-" non è ben visto, ma hai letto bene la nota in conf.d/wireless.example? Mi sa che è come per lo spazio (anche se un "\-" mi pare strano). |
Infatti non funziona...
Comincio a pensare che sia necessario segnalarlo come bug di baselayout. _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Tue Oct 30, 2007 9:45 pm Post subject: |
|
|
Dalla documentazione :
Code: |
2.c. Variable names and values
Variable names are dynamic. They normally follow the structure of variable_${interface|mac|essid|apmac}. For example, the variable dhcpcd_eth0 holds the value for dhcpcd options for eth0 and dhcpcd_essid holds the value for dhcpcd options when any interface connects to the ESSID "essid".
However, there is no hard and fast rule that states interface names must be ethx. In fact, many wireless interfaces have names like wlanx, rax as well as ethx. Also, some user defined interfaces such as bridges can be given any name, such as foo. To make life more interesting, wireless Access Points can have names with non alpha-numeric characters in them - this is important because you can configure networking parameters per ESSID.
The downside of all this is that Gentoo uses bash variables for networking - and bash cannot use anything outside of English alpha-numerics. To get around this limitation we change every character that is not an English alpha-numeric into a _ character.
Another downside of bash is the content of variables - some characters need to be escaped. This can be achived by placing the \ character in front of the character that needs to be escaped. The following list of characters needs to be escaped in this way: ", ' and \.
In this example we use wireless ESSID as they can contain the widest scope of characters. We shall use the ESSID My "\ NET:
|
Quando avevo avuto bisogno io il cambiamento da "-" a "_" era bastato; cosi' come c'e' scritto nella documentazione, o hanno cambiato qualcosa oppure hai sbagliato te qualcosa d'altro.
P.S. mi scuso con il team di traduzione della documentazione, ma io uso prevalentemente quella inglese e ho tutti i bookmarks a quella.... non prendetevela.  |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Wed Oct 31, 2007 9:35 am Post subject: |
|
|
MeMyselfAndI wrote: |
Quando avevo avuto bisogno io il cambiamento da "-" a "_" era bastato; cosi' come c'e' scritto nella documentazione, o hanno cambiato qualcosa oppure hai sbagliato te qualcosa d'altro.
|
Effettivamente hai ragione. Non funzionava in quanto (almeno secondo il wiki) utilizzando wpa_supplicant le configurazioni "per essid" generano un errore.
Visto che qualcuno sembra esserci riuscito ho continuato la discussione in questo topic del forum internazionale. _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Wed Oct 31, 2007 10:15 am Post subject: |
|
|
Strano, io non ho mai avuto problemi tra la configurazione di wpa_supplicant e /etc/conf.d/net... In pratica puoi usare solo il dhcp ?
Puoi postare i tuoi due file di configurazione ? (wpa_supplicant.conf e net ?) |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Wed Oct 31, 2007 10:56 am Post subject: |
|
|
MeMyselfAndI wrote: | Strano, io non ho mai avuto problemi tra la configurazione di wpa_supplicant e /etc/conf.d/net... In pratica puoi usare solo il dhcp ?
Puoi postare i tuoi due file di configurazione ? (wpa_supplicant.conf e net ?) |
No, il problema e' che, nel caso si utilizzi wpa_supplicant le configurazioni di etc/conf.d/net specifiche per essid non sembrano funzionare.
Secondo il wiki queste configurazioni vanno commentate:
Quote: | Note: You will need to comment out any config_ESSID settings, as they do not work in conjunction with wpa_supplicant. If not, you will receive the following hard-to-read error:
Nov 13 06:14:20 yourhost wpa_cli: interface ath0 CONNECTED
Nov 13 06:14:21 yourhost wpa_cli: executing '/etc/init.d/net.ath0 --quiet start' failed
|
La mia necessita' e' quella di, una volta associato ad un particolare essid (quello di casa mia) far partire pppoe... Ecco i miei file di conf supponendo che il mio ap dove devo effettuare la connessione pppoe si chiami foo-123
/etc/wpa_supplicant/wpa_supplicant.conf
Code: | network={
ssid="foo-123"
key_mgmt=NONE
wep_key0="xxxxxxxxxxxxxx"
wep_tx_keyidx=0
priority=5
}
# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.
network={
key_mgmt=NONE
priority=-9999999
}
|
/etc/conf.d/net
Code: | modules_eth1=( "wpa_supplicant" )
wpa_supplicant_eth1="-Dwext"
associate_timeout_eth1="15"
config_foo_123=("192.168.1.2/23")
config_foo_123=("ppp")
plugins_foo_123=("pppoe")
username_foo_123='xxxxxxx'
password_foo_123='xxxxxxx'
pppd_foo_123=("defaultroute" "usepeerdns")
|
_________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
MeMyselfAndI l33t


Joined: 15 Nov 2005 Posts: 784 Location: Between the monitor and the chair
|
Posted: Wed Oct 31, 2007 11:13 am Post subject: |
|
|
Boh non so aiutarti, non ho mai visto una configurazione simile, non sono nemmeno sicuro che si possa fare una cosa del genere... aspetta che qualcuno piu' epserto di reti ti risponda.
Ciao |
|
Back to top |
|
 |
topper_harley Guru


Joined: 05 Apr 2006 Posts: 363 Location: Treviso / Udine (Italy)
|
Posted: Wed Oct 31, 2007 11:29 am Post subject: |
|
|
MeMyselfAndI wrote: | Boh non so aiutarti, non ho mai visto una configurazione simile, non sono nemmeno sicuro che si possa fare una cosa del genere... aspetta che qualcuno piu' epserto di reti ti risponda.
Ciao |
Beh, il mio obiettivo e' quello di far partire pppoe ogni volta che mi associo ad un particolare essid, non necessariamente seguendo questo metodo. Se hai qualche idea migliore, o se esistono delle applicazioni che lo fanno gia', ogni soluzione e' benvenuta.
Per ottenere quella configurazione sono partito dal presupposto che utilizzando questa configurazione in /etc/conf.d/net:
Code: | config_ppp0=("ppp")
link_ppp0="eth1"
plugins_ppp0=("pppoe")
username_ppp0='xxxxxxx'
password_ppp0='xxxxxxxx
pppd_ppp0=("defaultroute" "usepeerdns" |
e creando il symlink /etc/init.d/net.ppp0, dopo ovviamente essermi associato all'ap in questione basta lanciare un /etc/init.d/net.ppp0 start per connettermi.
Avendo letto che sono possibili delle configurazioni specifiche per essid (e che la loro sintassi sembra identica a quelle classiche) ho provato a impostare lo stesso tipo di connessione per il singolo essid. _________________ http://topperh.ath.cx
Jabber: topper_harley@jabber.org
ICQ: 224179391
MSN: Topper_Harley80@gmail.com
Last FM |
|
Back to top |
|
 |
|