Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/conf.d/net e EESID contenenti il carattere "-"
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Tue Oct 30, 2007 3:45 pm    Post subject: /etc/conf.d/net e EESID contenenti il carattere "-" Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Tue Oct 30, 2007 4:08 pm    Post subject: Reply with quote

Basta sostituire "-" con "_"
Back to top
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Tue Oct 30, 2007 4:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Tue Oct 30, 2007 4:15 pm    Post subject: Reply with quote

nel file di conf intendo... mioessid-123 diventa mioessid_123
Back to top
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Tue Oct 30, 2007 4:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Tue Oct 30, 2007 4:18 pm    Post subject: Reply with quote

e non fai prima a provare ?
Back to top
View user's profile Send private message
Kernel78
Moderator
Moderator


Joined: 24 Jun 2005
Posts: 3654

PostPosted: Tue Oct 30, 2007 6:12 pm    Post subject: Reply with quote

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...

:lol: :lol: :lol:
_________________
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
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Tue Oct 30, 2007 6:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
djinnZ
Advocate
Advocate


Joined: 02 Nov 2006
Posts: 4831
Location: somewhere in L.O.S.

PostPosted: Tue Oct 30, 2007 7:08 pm    Post subject: Reply with quote

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:wink:
mala tempora currunt...mater stultorum semper pregna est :evil:
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist :wink:
Back to top
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Tue Oct 30, 2007 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Tue Oct 30, 2007 9:45 pm    Post subject: Reply with quote

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. :D
Back to top
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Wed Oct 31, 2007 9:35 am    Post subject: Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Wed Oct 31, 2007 10:15 am    Post subject: Reply with quote

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
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Wed Oct 31, 2007 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
MeMyselfAndI
l33t
l33t


Joined: 15 Nov 2005
Posts: 784
Location: Between the monitor and the chair

PostPosted: Wed Oct 31, 2007 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message
topper_harley
Guru
Guru


Joined: 05 Apr 2006
Posts: 363
Location: Treviso / Udine (Italy)

PostPosted: Wed Oct 31, 2007 11:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum