Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto+How-to] NAP Bluetooth Linux, Client Windows/Linux
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
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Tue Aug 09, 2005 3:35 pm    Post subject: [Risolto+How-to] NAP Bluetooth Linux, Client Windows/Linux Reply with quote

EDIT3 Risolto finalmente!!!!!!!!! ora vedo se riesco a postare un Howto! :D

EDIT 2: discutendo sul forum internazionale ho trovato mlte informazioni interessanti, quindi aggiorno anche il titolo, da "condivisione internet bluetooth e windows" a "NAP Bluetooth Linux, Client Windows/Linux"

EDIT: devo collegarci 2 pc con windows, quindi mi sembra di aver capito, devo fare un acces point..
Avrei la necessita di far condividere l'accesso a internet del pc con gentoo con 2 portalil1 con windows via bluetooth...

ho letto:

http://gentoo-wiki.com/HOWTO_The_host-to-host_Bluetooth

e

http://gentoo-wiki.com/HOWTO_Configure_a_bluetooth_network_access_point


ma non ho capito se fanno al caso mio.... potreste darmi qualche dritta?


Last edited by Ciccio Bueo on Wed Sep 21, 2005 8:50 am; edited 5 times in total
Back to top
View user's profile Send private message
102376
l33t
l33t


Joined: 19 Mar 2005
Posts: 608

PostPosted: Tue Aug 09, 2005 4:27 pm    Post subject: Reply with quote

dando un occhiata penso che possano fare al caso tuo! il secondo link non penso possa fare al caso tuo

penso che devo crearti una connesione ad hoc come quella con il wireless senza acces point!

coiè 2 pc connessi direttamente senza passare da un acces point
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Thu Aug 11, 2005 7:03 am    Post subject: Reply with quote

Grazie! appena posso farò delle prove... ora mi manca il tempo... :D
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Sat Aug 27, 2005 2:52 pm    Post subject: Reply with quote

[OT]lo sklero del bluetooth mi appassiona... ma vorrei tanto qualcosa di più umano.... più semplice... quasi alla windows... [/OT]



allora... ho seguito le guide che avevo indicato, ma ho una serie di problemi:

ad un certo punto dicono:

Create the startup script net.bnep0:


File: /etc/init.d/net.bnep0


Code:
#!/sbin/runscript
 
 depend () {
        need net
 }
 
 start() {
        ifconfig bnep0 up
        brctl addif lan bnep0
        eend 0
 }

 stop () {
        eend 0
 }




Set the eXecute bit on the script:

Code:


 $ chmod 0755 /etc/init.d/net.bnep0



ma così lo script non diventa avviabile, se infatti faccio /etc/init.d/net.bnep0 start, non succede assolutamnete nulla, neanche se lo stoppo e lo riavvio...


e qui:
Code:
File: /etc/conf.d/net

 
 bridge_lan="eth0"
 ifconfig_lan=( "192.168.0.1 netmask 255.255.255.0" )
 routes_lan=(
      "default gw 192.168.0.1"
 )
 



ma tutto il resto del file devo cancellarlo? l'face lo lascio?

e poi per il mitico pppoe in kernel mode.... mi funziona perfettamente, ma usa appunto la eth0, allora ho pensato bene di modificare lo script /etc/init.d/net.ppp0, sostituendo a net.eth0, net.lan... solo che così non mi và più internet... non pingo più nulla...


qualche info:

Code:
# lsmod
Module                  Size  Used by
ppp_synctty             7424  0
ppp_async               8672  0
pppoe                  10496  2
pppox                   2664  1 pppoe
ppp_generic            21364  8 ppp_synctty,ppp_async,pppoe,pppox
slhc                    5920  1 ppp_generic
hci_usb                13160  1
snd_seq                50416  0
snd_via82xx            23136  1
snd_ac97_codec         82940  1 snd_via82xx
snd_pcm                81608  2 snd_via82xx,snd_ac97_codec
snd_timer              21540  2 snd_seq,snd_pcm
snd_page_alloc          7652  2 snd_via82xx,snd_pcm
snd_mpu401_uart         6368  1 snd_via82xx
snd_rawmidi            18976  1 snd_mpu401_uart
snd_seq_device          7148  2 snd_seq,snd_rawmidi
snd                    42808  10 snd_seq,snd_via82xx,snd_ac97_codec,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore               7392  1 snd
bnep                   12384  0
vt1211                 21652  0
i2c_sensor              2816  1 vt1211
drm                    60756  0
via_agp                 7648  1
agpgart                29608  2 drm,via_agp
rfcomm                 35196  0
l2cap                  22116  4 bnep,rfcomm
bluetooth              43812  4 hci_usb,bnep,rfcomm,l2cap


e all'avvio dell'init bluetooth mi appare anche questa cosa su pand:

Code:
 
* Starting Bluetooth ...
*     Starting hcid ...                                                  [ ok ]
*     Starting sdpd ...                                                  [ ok ]
*     Starting rfcomm ...                                                [ ok ]
*     Starting pand ...
Bluetooth PAN daemon version 2.19
Usage:
        pand <options>
Options:
        --show --list -l          Show active PAN connections
        --listen -s               Listen for PAN connections
        --connect -c <bdaddr>     Create PAN connection
        --autozap -z              Disconnect automatically on exit
        --search -Q[duration]     Search and connect
        --kill -k <bdaddr>        Kill PAN connection
        --killall -K              Kill all PAN connections
        --role -r <role>          Local PAN role (PANU, NAP, GN)
        --service -d <role>       Remote PAN service (PANU, NAP, GN)
        --ethernet -e <name>      Network interface name
        --device -i <bdaddr>      Source bdaddr
        --nosdp -D                Disable SDP
        --auth -A                 Enable authentication
        --encrypt -E              Enable encryption
        --secure -S               Secure connection
        --master -M               Become the master of a piconet
        --nodetach -n             Do not become a daemon
        --persist -p[interval]    Persist mode
        --cache -C[valid]         Cache addresses
        --pidfile -P <pidfile>    Create PID file                         [ ok ]



ps. ovviamente il pc non viene rilevato dal client windows..

ogni suggerimento è ben gradito.. grazie! :wink:
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Fri Sep 09, 2005 9:10 am    Post subject: Reply with quote

visto che mis sono fatto il serverino... e ne vado fiero! :wink: , ora lo devo configurare come NAP Bluetooth per cndivedere la rete anche con i client portatili con Windows.

Dopo una interessante discussione sul forum internazionazionale (https://forums.gentoo.org/viewtopic.php?p=2705346) e una lettura approfondita di
http://bluez.sourceforge.net/contrib/HOWTO-PAN ecco cosa sono riuscito a fare:

Ho modificato così i file di configurazione del bluetooth:

/etc/conf.d/bluetooth

Code:


# Bluetooth configuraton file

# Start of hcid (allowed values are "true" and "false")
HCID_ENABLE=true

# Config file for hcid
HCID_CONFIG="/etc/bluetooth/hcid.conf"

# Start sdpd (allowed values are "true" and "false")
SDPD_ENABLE=true

# Start hidd (allowed values are "true" and "false")
HIDD_ENABLE=false

# Arguments to hidd
HIDD_OPTIONS=""

# Run hid2hci (allowed values are "true" and "false")
HID2HCI_ENABLE=false

# Bind rfcomm devices (allowed values are "true" and "false")
RFCOMM_ENABLE=true

# Config file for rfcomm
RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

# Start dund (allowed values are "true" and "false")
DUND_ENABLE=false

# Arguments to dund
DUND_OPTIONS="--listen --persist"

# Start pand (allowed values are "true" and "false")
PAND_ENABLE=true

# Arguments to pand
PAND_OPTIONS="--listen --role NAP --master --autozap --persist --ethernet bnep0"



/etc/bluetooth/hcid.conf

Code:

#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security user;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        # PIN helper
        #pin_helper /usr/bin/bluepin;
        pin_helper /etc/bluetooth/pin-helper

        # D-Bus PIN helper
        #dbus_pin_helper;
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "NAP Bluetooth Home";

        # Local device class
        class 0x3e0100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable; pscan enable;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm master;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;

        # Authentication and Encryption (Security Mode 3)
        #auth enable;
        #encrypt enable;
}


/etc/bluetooth/rfcomm.conf non và cambiato

Code:

#
# RFCOMM configuration file.
#
# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
#

rfcomm0 {
        # Automatically bind the device at startup
        bind no;

        # Bluetooth address of the device
        device 11:22:33:44:55:66;

        # RFCOMM channel for the connection
        channel 1;

        # Description of the connection
        comment "Example Bluetooth device";
}


/etc/bluetooth/pin-helper

Code:

#!/bin/sh
echo -n "PIN:"
cat /etc/bluetooth/pin


lo rendo eseguibile:

Code:
chmod 0755 /etc/bluetooth/pin-helper


/etc/bluetooth/pin >> mettete il vostro pin, che deve essere lo stesso per tutte le macchine.

poi creo una cartella che si chiami "pan"

Code:
mkdir /etc/bluetooth/pan/


e dentro la cartella pan il file:

/etc/bluetooth/pan/dev-up

Code:


#!/bin/sh
        brctl addif pan0 $1     # $1 is the new if name, passed by 'pand'
        ifconfig $1 0.0.0.0


poi lo rendo eseguibile:
Code:
chmod 0755 /etc/bluetooth/pan/dev-up


per continuare bisogna installare le bridge utils:

Code:
# emerge -s bridge-utils
Searching...
[ Results for search key : bridge-utils ]
[ Applications found : 1 ]

*  net-misc/bridge-utils
      Latest version available: 1.0.6-r3
      Latest version installed: 1.0.6-r3
      Size of downloaded files: 80 kB
      Homepage:    http://bridge.sourceforge.net/
      Description: Tools for configuring the Linux kernel 802.1d Ethernet Bridge      License:     GPL-2


riavvio il bluetooth:

/etc/init.d/bluetooth restart

Code:

 * Caching service dependencies ...                                       [ ok ]
 * Shutting down Bluetooth ...
 *     Stopping pand ...                                                  [ ok ]
 *     Stopping rfcomm ...                                                [ ok ]
 *     Stopping sdpd ...                                                  [ ok ]
 *     Stopping hcid ...                                                  [ ok ]
 * Starting Bluetooth ...
 *     Starting hcid ...                                                  [ ok ]
 *     Starting sdpd ...                                                  [ ok ]
 *     Starting rfcomm ...                                                [ ok ]
 *     Starting pand ...                                                  [ ok ]



Aggiungo il bridge per l'interfaccia di rete "virtuale", perchè la scheda connessa alla lan è la eth0, quella connessa a internet è la eth1.

Code:

# brctl addbr pan0 eth0


la configuro:

Code:
ifconfig pan0 192.168.0.3


però... questo non dovrebbe farlo automaticamente il DHCP? :roll:


ora sistemo il bridge:

Code:
#brctl setfd pan0 0
#brctl stp pan0 off
#brctl addif pan0 eth0


controllo se è stato creato:

# brctl show

Code:
 
bridge name     bridge id               STP enabled     interfaces
pan0            8000.00105af49e1a       no              eth0


ifconfig -a

Code:

eth0      Link encap:Ethernet  HWaddr 00:10:5A:F4:9E:1A
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3412064 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3809495 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1289993655 (1230.2 Mb)  TX bytes:3193092438 (3045.1 Mb)
          Interrupt:11 Base address:0xd400

eth1      Link encap:Ethernet  HWaddr 00:04:76:DC:72:A2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3823504 errors:0 dropped:0 overruns:2 frame:0
          TX packets:3414635 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3244861108 (3094.5 Mb)  TX bytes:1314782484 (1253.8 Mb)
          Interrupt:5 Base address:0xd800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1637 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1637 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:230182 (224.7 Kb)  TX bytes:230182 (224.7 Kb)

pan0      Link encap:Ethernet  HWaddr 00:10:5A:F4:9E:1A
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1441 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:118698 (115.9 Kb)  TX bytes:0 (0.0 b)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:82.50.XXX.XXX  P-t-P:192.168.100.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:3818511 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3409642 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:3158522156 (3012.2 Mb)  TX bytes:1239092230 (1



e in effetti c'è...


ora da windows vedo il NAP Linux, (in teoria....)


ma non si vedono.... non capisco cosa ho sbagliato... perchè quando lo avevo configurato sull'altro linux pc riuscivano a connettersi...
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Fri Sep 09, 2005 6:37 pm    Post subject: Reply with quote

follia pura.... sto per mangiarmi le chiavette bluetooth...

allora, ho modificato così i file:

Code:
 # cat /etc/bluetooth/hcid.conf | grep -v "#"
options {
        autoinit yes;

        security auto;

        pairing multi;

        pin_helper /etc/bluetooth/pin-helper;

}

device {
        name "NAP Bluetooth %h";

        class 0x020104;


        iscan enable; pscan enable;

        lm accept;

        lp rswitch,hold,sniff,park;

        auth enable;
        encrypt enable;
}


e il pand:

Code:
# cat /etc/conf.d/bluetooth | grep -v "#"

HCID_ENABLE=true

HCID_CONFIG="/etc/bluetooth/hcid.conf"

SDPD_ENABLE=true

HIDD_ENABLE=false

HIDD_OPTIONS=""

HID2HCI_ENABLE=false

RFCOMM_ENABLE=true

RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

DUND_ENABLE=false

DUND_OPTIONS="--listen --persist"

PAND_ENABLE=true

PAND_OPTIONS="--listen --role NAP "



ma ho dovuto modificare i parametri con hciconfig.... perchè anche se rilancio l'init del bluetooth non cambiano, nanache con un riavvio! non ho idea come mai...

ora il client vede il NAP Gentoo, ma non riesce a connettersi.....

se qualcuno ha qualche idea di dove posso controllare per trovare la soluzione... un qualsiasi suggeimento.... è ben accetto...

:cry:
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Mon Sep 12, 2005 1:48 pm    Post subject: Reply with quote

sto leggendo l'impossibile per venirne a capo...


ecco gli sviluppi, sperando che ne esca qualche consiglio:


1) considerazione: forse dipende da iptables?

per configurare il router ho seguito questa guida:
http://www.gentoo.org/doc/it/home-router-howto.xml
ho cambiato solo eth1 in ppp0 perchè uso l'adsl..

poi ho letto questo:
http://www.cs.ucla.edu/~cclljj/interest/notes/bluez/pand_bridge_nap.html

dove fanno un accenno a ip tables, allora ho provato a configuralo aggiungendo queste voci:
Code:
# iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     udp  --  anywhere             anywhere            udp dpt:bootps reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp dpt:domain reject-with icmp-port-unreachable
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
DROP       tcp  --  anywhere             anywhere            tcp dpts:0:1023
DROP       udp  --  anywhere             anywhere            udp dpts:0:1023

Chain FORWARD (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             192.168.0.0/16
ACCEPT     all  --  192.168.0.0/16       anywhere
ACCEPT     all  --  anywhere             192.168.0.0/16
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


ma non so se sono nel giusto... loro consigliano di usare questo script.. però sarebbe rpedisposto per l'eth0 mentre io uso come connessione all'esterno la ppp0...

Code:
#!/bin/sh

#CRITICAL: Enable IP forwarding since it is disabled by default.
#
echo "1" > /proc/sys/net/ipv4/ip_forward

###
### Enable rogue packet filtering on all interfaces
###
for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do
echo 1 >> $f
#echo $f
done

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i pan0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT



2) considerazione: dipende da hotplug/udev?

forse ho bisogno di qualche regola perchè quando la connessione inizia tra due periferiche bluetooth viene creata una nuova interfaccia, sta maledetta bnep0, che a me non appare però... perchè per esempio, per configurare il telefonino con il bluetooth, (su un altro pc) avevo dato un "mknode" perchè udev lo riconoscesse... forse devo farlo anche per questo bnep?

vi assicuro che ho cercato molto... ma non ne sono venuto a capo... :cry:


EDIT: aggiungo che se dal NAP provo a connettermi al client, con il comando

Code:
 hcitool cc 00:10:60:A6:A2:XX


risulto connesso... win rileva la connessione, ma non ci facio nulla... non và in internet, non si crea l'intrfaccia bnep.

mah..
Back to top
View user's profile Send private message
power83
l33t
l33t


Joined: 28 Nov 2004
Posts: 638

PostPosted: Tue Sep 13, 2005 12:08 pm    Post subject: Reply with quote

Appena ho tempo mi metto pure io a provare sta cosa, mi serve anche a me.

Per il fatto del collegamento, ti basta avviare il bluetooth, senza necesariamente il pand x riuscire a collegarti, ma dopo nn fai nulla.

ora e' strano che nn suceda nulla con quello che stai facendo tu.

ps: accettoa tutto da iptables x ora, lo sistemi poi alla fine...
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Tue Sep 13, 2005 1:36 pm    Post subject: Reply with quote

senza avviare pand dici? non credo funzioni...


ma per 'iptables... come faccio a correggerlo? la mia attuale configurazione l'ho postata qui:
https://forums.gentoo.org/viewtopic-p-2721945.html#2721945

se hai una qualsisi idea da provare... dimmi pure, senza pietà!
Back to top
View user's profile Send private message
power83
l33t
l33t


Joined: 28 Nov 2004
Posts: 638

PostPosted: Tue Sep 13, 2005 5:42 pm    Post subject: Reply with quote

si penso che nn serva pand.

x iptables, elimini tutto e imposti tutto su ACCEPT!
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Wed Sep 14, 2005 12:23 pm    Post subject: Reply with quote

senza avviare pand--- il client non vede il NAP (testato) e anche la guida http://www.gentoo.org/doc/en/bluetooth-guide.xml
non ha dato i riusltati sperati... nessun miglioramneto, la connessione non avviene...
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Wed Sep 14, 2005 4:54 pm    Post subject: Reply with quote

appena ho tempo provo ad installare un'altra distribuzione, per vedere se questo problema è di un bug di gentoo oppure è un problema hw.


purtroppo non vedo alternativa. (bè forse potrei installare windows..... ma anche no.)
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Thu Sep 15, 2005 1:15 pm    Post subject: Reply with quote

ho fatto una prova usando come NAP un windows, e funziona, ma attenzione, funziona solo se installo i driver specifici delle chiavette bt, praticamente windows con sp2 supporta nativamente sono una connessione punto-punto, non permette l'accesso ad un eventuale NAP.

quindi... quando avrò tempro riproverò a confgiurare il nap su linux, per ora, devo viaggiare con il s.o. più simpatico del mondo. :(
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Sat Sep 17, 2005 6:28 pm    Post subject: Reply with quote

ci sono quasi..... ora mi spunta l'interfaccia bnep0!

e sono molto felice, ora vedo di configurarla, ma dovrei farcela. confermo quando detto prima, ovvero dipende dai driver windows del bluetooth, quelli standard non supportano nativamente il NAP. :D

[EDIT]

allora ok, mi si crea l'interfaccia bnep... ora volevo sapere, anzi, volevo chiedere, come devo fare a fa uno scrip che mi configuri le interfacce quando queste si creano...

intanto faccio delle prove poi aggiorno il post. :D
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Sat Sep 17, 2005 7:51 pm    Post subject: Reply with quote

Visto che la connessione c'è, finalmente, ora devo configurare il resto della rete, ovvero il firewall.

ho letto questo, http://gentoo-wiki.com/HOWTO_Configure_a_bluetooth_network_access_point

ma non fà al acaso mio, perchè ho la seguente situazione:

1 pc SERVER - NAP Bluetooth e internet
--> eth0 collegata alla LAN
--> eth1 collegata all'adsl
--> bnep bluetooth.... da esaminare

1 pc client Gentoo connesso via LAN

X pc client Windows connessi via Bluetooth.

----------------

Allora, la configurazione della lan andrebbe perfetta, dhcp etc. etc. configurato paro paro dalla guida gentoo http://www.gentoo.org/doc/it/home-router-howto.xml


ora però quando si avvia la connessione bluetooth, mi spunta questa nuova interfaccia, che si chiama bnep0,
con cui però non ci faccio nulla, perchè il client non và in internet ne vede samba.

come ho letto qui: http://bluez.sourceforge.net/contrib/HOWTO-PAN devo fare un bridge per far funzionare il tutto, allora lo creo e ho questo risultato:

Code:
 # brctl show
bridge name     bridge id               STP enabled     interfaces
pan0            8000.00105af49e1a       no              eth0
                                                        bnep0


a questo punto internet non và più sul client linux... e neanche sul client windows bluetooth.

allora leggo qui: http://www.cs.ucla.edu/~cclljj/interest/notes/bluez/pand_bridge_nap.html

dove appunto dicono di fare quelle modifiche a iptables, ma non mi sono di aiuto...

A rigor di logica ho piallato iptables, e ho riseguito la configurazione dell'how-to home oruter, sostituendo a eth0 la nuova periferica pan0 (che sarebbe il bridge) , tutto il resto uguale...
ma internet non và lo stesso, e sinceramente non capisco perchè.

scusatemi la prolissità, ma fatico anche a spiegarmi...

ecco alcuni dati che magari possono essere utili:

ifconfig -a

Code:
 bnep0     Link encap:Ethernet  HWaddr 00:10:60:A5:BD:XX
          inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:555 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36613 (35.7 Kb)  TX bytes:33720 (32.9 Kb)

eth0      Link encap:Ethernet  HWaddr 00:10:5A:F4:9E:1A
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:82364 errors:0 dropped:0 overruns:0 frame:0
          TX packets:100725 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17077861 (16.2 Mb)  TX bytes:72094437 (68.7 Mb)
          Interrupt:11 Base address:0xd400

eth1      Link encap:Ethernet  HWaddr 00:04:76:DC:72:A2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35869 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38327 errors:0 dropped:0 overruns:0 carrier:0
          collisions:33 txqueuelen:1000
          RX bytes:7333688 (6.9 Mb)  TX bytes:12120883 (11.5 Mb)
          Interrupt:5 Base address:0xd800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7905 (7.7 Kb)  TX bytes:7905 (7.7 Kb)

pan0      Link encap:Ethernet  HWaddr 00:10:5A:F4:9E:1A
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5023 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:330316 (322.5 Kb)  TX bytes:0 (0.0 b)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:82.60.161.XXX  P-t-P:192.168.100.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:35552 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38031 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:6494100 (6.1 Mb)  TX bytes:11291823 (10.7 Mb)


Code:
# iptables --list Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     udp  --  anywhere             anywhere            udp dpt:bootps reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp dpt:domain reject-with icmp-port-unreachable
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
DROP       tcp  --  anywhere             anywhere            tcp dpts:0:1023
DROP       udp  --  anywhere             anywhere            udp dpts:0:1023

Chain FORWARD (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             192.168.0.0/16
ACCEPT     all  --  192.168.0.0/16       anywhere
ACCEPT     all  --  anywhere             192.168.0.0/16

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination



il dhcp funziona anche per le interfacce bluetooth?

grazie... :D
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Sun Sep 18, 2005 7:25 pm    Post subject: Reply with quote

manca poco e ci dovrei essere...


Code:

# brctl addbr pan0
#  ifconfig pan0 10.0.0.1
#  brctl setfd pan0 0
#  brctl stp pan0 off


praticamente ho fatto un nuovo bridge che chiamo pan0 a cui verranno aggiunte tutte le bnep che si creano..

dosì, dopo aver aggiunto lo script dev-up che mi configura le nuove interfacce, queste vengono tutte aggiunte al bridge pan0..

poi ho modificato iptables con questo script:

Code:
#!/bin/sh

#CRITICAL: Enable IP forwarding since it is disabled by default.
#
echo "1" > /proc/sys/net/ipv4/ip_forward

###
### Enable rogue packet filtering on all interfaces
###
for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do
echo 1 >> $f
#echo $f
done

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i pan0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT


e in effeti i pc si connettono e il client windows in esame naviga in rete...

peccato che dopo un pò si disconnetta... anzi no, semplicemente non funziona più la rete, bè, c'è ancora da lavorare, ma mi sembra di essere a buon punto..
:D
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Tue Sep 20, 2005 7:37 am    Post subject: Reply with quote

evouluzione:

script per l'avvio del NAP, ho crato un novo script per init utilizzabile con il comando rc-update:

nano -w /etc/init.d/net.pan0

Code:
#!/sbin/runscript
# Copyright (c) 2004-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:  uberlord Exp $

#NB: Config is in /etc/conf.d/pan0


 depend () {
        need net
 }

 start() {
        ebegin "Starting Network Access Point Bluetooth"
        start-stop-daemon --start --quiet --exec /etc/conf.d/pan0
        eend $?
 }

 stop () {


e il suo relativo script di cofngiurazione:

nano -w /etc/conf.d/pan0

Code:
#!/bin/bash

#creo il bridge:
brctl addbr pan0

#configuro l'idnirizzo ip del bridge:
ifconfig pan0 192.168.0.2

#configurazioni del bridge:
brctl setfd pan0 0
brctl stp pan0 off


entrambi devono essere eseguibili:

Code:
 
# chmod 0755 /etc/conf.d/pan0
# chmod 0755 /etc/init.d/net.pan0


finalmente:

Code:
 # /etc/init.d/net.pan0 start
 * Starting Network Access Point Bluetooth ...                            [ ok ]


Code:
pan0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


Code:
 # rc-update add net.pan0 default
 * net.pan0 added to runlevel default
 * rc-update complete.


al momento però non posso stoppare lo script, perchè non mi si cancella il bridge... :roll:


comunque la connessione funziona... devo sitemare il firewall e dovrei esserci...

Code:
 
# pand --show
bnep0 00:10:60:A6:A2:D4 NAP
# brctl show
bridge name     bridge id               STP enabled     interfaces
pan0            8000.001060a5bd11       no              bnep0
Back to top
View user's profile Send private message
Ciccio Bueo
l33t
l33t


Joined: 19 Oct 2004
Posts: 834
Location: Treviso

PostPosted: Wed Sep 21, 2005 7:03 am    Post subject: Reply with quote

Risolto!!!! Finalmente!! :D

Dire che è stato un parto è riduttivo....

Provo a postare un mini how-to, sperando che a qualcuno possa servire!

Premessa.................. La documentazione sul bluetooth è notevole, ma si trovano veramente poche informazioni "univoche", e quasi nulla in italiano, insomma, veramente uno sklero.


HOW-TO Network Access Point Bluetooth
Client Windows / Linux, Condivisione stampanti, connessione a internet, Samba


Link di base:

Documentazione ufficiale Bluez:
http://bluez.sourceforge.net/contrib/HOWTO-PAN

Realizzazione di un bridge di rete con Bluez:
http://www.cs.ucla.edu/~cclljj/interest/notes/bluez/pand_bridge_nap.html

Documentazione Gentoo su condivisione Cups/Samba/Antivirus:
http://www.gentoo.org/doc/it/quick-samba-howto.xml

Documentazione Gentoo sulla configurazione di un Home Router:
http://www.gentoo.org/doc/it/home-router-howto.xml

Documentazione di Shorewall per la configurazione con 3 interfacce di rete:
http://www.shorewall.net/three-interface.htm

Premessa 2: Se ci sono errori non stupratemi... dopo tutte quello che ho fatto, magari mi scrodo di scrivere qualcosa!!! :oops:


1) Configuraimo il kernel:

Alla voce Networking support scegliamo Networking options:





in " Networking support" metttiamo bluetooth come modulo:
Code:
 <M> Bluetooth subsystem support  --->


Code:
<M> 802.1d Ethernet Bridging                                         │ │
  │ │<M> 802.1Q VLAN Support 
  │ │<*> WAN router



Poi:
Code:
--- Bluetooth subsystem support                       │ │
  │ │               <M>   L2CAP protocol support                          │ │
  │ │               <M>   SCO links support                               │ │
  │ │               <M>   RFCOMM protocol support                         │ │
  │ │               [*]     RFCOMM TTY support                            │ │
  │ │               <M>   BNEP protocol support                           │ │
  │ │               [*]     Multicast filter support                      │ │
  │ │               [*]     Protocol filter support                       │ │
  │ │               <M>   HIDP protocol support       


e sotto Bluetooth device drivers --->

Code:
<M> HCI USB driver                                       │ │
  │ │            [*]   SCO (voice) support                                │ │
  │ │            <M> HCI UART driver                                      │ │
  │ │            [*]   UART (H4) protocol support                         │ │
  │ │            [*]   BCSP protocol support                              │ │
  │ │            [*]     Transmit CRC with every BCSP packet              │ │
  │ │            <M> HCI BCM203x USB driver                               │ │
  │ │            <M> HCI BPA10x USB driver                                │ │
  │ │            <M> HCI BlueFRITZ! USB driver                            │ │
  │ │            <M> HCI VHCI (Virtual HCI device) driver         


(forse ho messo anche cose che non servono)

tornando a Networking support, andiamo sotto Wan interfaces --->

Code:
 [*] Wan interfaces support                                    │ │
  │ │       < >   Comtrol Hostess SV-11 support                           │ │
  │ │       < >   COSA/SRP sync serial boards support                     │ │
  │ │       < >   Etinc PCISYNC serial board support                      │ │
  │ │       < >   LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards         │ │
  │ │       < >   Sealevel Systems 4021 support                           │ │
  │ │       < >   SyncLink HDLC/SYNCPPP support                           │ │
  │ │       < >   Generic HDLC layer                                      │ │
  │ │       < >   Frame Relay DLCI support                                │ │
  │ │       [*]   WAN router drivers             



Serve ovviamente configurare anche il supporto a iptables, smaba, e alle stamapnti, ma questo non si discosta dalle guide ufficiali.



Poi bisogna emergere tutto il necessario:

Samba (che ho emerso che le USE idnicate nella guida gentoo)
Cups
Foomatic
bluez-utils
bluez-libs
bluez-hcidump (utile strumento per vedere esattmanete cosa si dicono le interfacce bluetooth)
bridge-utils (necessario per configurare il bridge di rete)
iptables
shorewall

Partiamo dalla configurazione del bluetooth:

Per quello che abbiamo configurazto come modulo, dobbiamo aggiungere nell'autoload del kernel:

io ho aggiunto solo "bnep"

E poi i relativi file di configurazione del bluetooth:

Code:
# cat /etc/conf.d/bluetooth | grep -ve "#"

HCID_ENABLE=true

HCID_CONFIG="/etc/bluetooth/hcid.conf"

SDPD_ENABLE=true

HIDD_ENABLE=false

HIDD_OPTIONS=""

HID2HCI_ENABLE=false

RFCOMM_ENABLE=true

RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

DUND_ENABLE=false

DUND_OPTIONS="--listen --persist"

PAND_ENABLE=true

PAND_OPTIONS="--listen --role NAP --master --autozap --persist"




Code:
# cat /etc/bluetooth/hcid.conf | grep -ve "#"

options {
        autoinit yes;

        security auto;

        pairing multi;

        pin_helper /etc/bluetooth/pin-helper;

}

device {
        name "NAP Bluetooth at %h (%d)";

        class 0x3e0100;


        iscan enable; pscan enable;

        lm accept;

        lp rswitch,hold,sniff,park;

}


Code:
# cat /etc/bluetooth/rfcomm.conf | grep -ve "#"

rfcomm0 {
        bind yes;

        device 00:10:60:A6:A2:XX; (qui va il vostro indirizzo della periferica bluetooth, ma nel caso del nap non è necessario)

        channel 1;

        comment "Example Bluetooth device";
}


Code:
# cat /etc/bluetooth/pin
1234
dovete mettere il vostro pin... che deve essere lo stesso su tutte le macchine


Code:
 # cat /etc/bluetooth/pin-helper
#!/bin/sh
echo -n "PIN:"
cat /etc/bluetooth/pin


dovete renderlo esebuibile con chmod 0755

e poi creiamo una cartella che si chiami pan e dentro ci và lo script dev-up che serve a creare le interfacce bnep:

Code:
# cat /etc/bluetooth/pan/dev-up
#!/bin/sh
        brctl addif pan0 $1     # $1 is the new if name, passed by 'pand'
        ifconfig $1 0.0.0.0
e anche questo deve essere eseguibile.

ora và aggiunto il bluetooth al runlevel di default, e avviato:

Code:
rc-update add bluetooth default
/etc/init.d/bluetooth start


e ora vediamo se c'è tutto:

Code:
 # hciconfig -a
hci0:   Type: USB
        BD Address: 00:10:60:A5:BD:11 ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:30729 acl:297 sco:0 events:103 errors:0
        TX bytes:1842 acl:56 sco:0 commands:26 errors:0
        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT
        Name: 'NAP Bluetooth at homeserver (0)'
        Class: 0x3e0100
        Service Classes: Networking, Rendering, Capturing
        Device Class: Computer, Uncategorized
        HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
        Manufacturer: Cambridge Silicon Radio (10)


Code:
# hcitool dev
Devices:
        hci0    00:10:60:A5:BD:11
( che è la periferica sul server)

con hcitool scan vediamo le periferiche raggiungibili.

Code:
 # hcitool scan
Scanning ...
        00:10:60:A3:31:F2       MATTEO
        00:10:60:A6:A2:D4       ELISA


il client Elisa è una portatile con windows xp sp2, che si drovrà connettere in wirless alla rete, l'altro è un fisso con gentoo, che per questo test ho aggiutno una chiavetta bluetooth oltre alla normale connessione di rete.


Siccomei pc con bluetooth sono più di uno, e lo scopo di fare un NAP è proprio quello di poter connettere un numero imprecisato di client, bisogna realizzare un bridge di rete, in modo che io nel firewalle e nelle altre impostazioni configuro un'interfaccia statica, che a sua volta comprende un numero imprecisato di client.

Inoltre mi sembra più che utile metterlo negli script d'avvio, così non devo rionfigurare tutto ogni volta che riavvio il server.

in /etc/init.d/ creo il file net.pan0 contenente queste righe:

Code:
 File: /etc/init.d/net.pan0

#!/sbin/runscript
# Copyright (c) 2004-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:  uberlord Exp $

#NB: Config is in /etc/conf.d/pan0


 depend () {
        need net
 }

 start() {
        ebegin "Starting Network Access Point Bluetooth"
        start-stop-daemon --start --quiet --exec /etc/conf.d/pan0
        eend $?
 }

 stop () {


(come si fanno gli script d'avvio per gentoo? http://www.gentoo.org/doc/it/handbook/handbook-x86.xml?part=2&chap=4)

Lo script richiama un altro script che contiene appunto la configurazione del bridge, che ho messo in /etc/conf.d/ chiamandolo pan0:

Code:
#!/bin/bash

#creo il bridge:
brctl addbr pan0

#configuro l'indirizzo ip del bridge:
ifconfig pan0 10.10.1.1 broadcast 10.10.1.255 netmask 255.255.255.0

#configurazioni del bridge:
brctl setfd pan0 0
brctl stp pan0 off


entrambi i file devo essere impostati come eseguibili (chmod 0755), ora potete aggiungere al runlevel di default il nuovo script e poi avviarlo.

Code:
 
# rc-update add net.pan0 default
# /etc/init.d/net.pan0 start



A questo punto devo dire che ho avuto dei problemi pazzeschi, perchè la connessione non partiva tra il pc con windows e il NAP, questo perchè mi ero ostinato ad usare i driver standard di windows per creare la rete, mentre è necessario usare i driver proprietari del produttore dell'hardware, e impostando tra i servizi a cui si deve collegare anche la lan bluetooth. Fatto ciò, quando visualizzerete le connessioni di rete, sarà visibile una nuova interfaccia che si chiama appunto Bluetooth Lan Access etc. etc. Senza questo passaggio non se ne può venire a capo.

Un altra cosa, il protocollo bnep al momento non supporta il dhcp, quindi bisogna configurare a manina i parametri della connessione di rete di windows, io ho usato:

indirizzo ip: 10.10.1.2
subnetmask: 255.255.255.0
gateway: 10.10.1.1 (che è l'ip della scheda di rete pan0)

per ora, per i dns sto usando quelli forniti dal mio ISP.

Ora da windows cercate le periferiche raggiungibili, e dovreste vedere il vostro NAP, e anche vedere che fornisce il servizio di "accesso alla rete" , da lì dovreste essere in grado di conntervi alla rete locale.

Facciamo un controllino sul server epr vedere se effettivmante c'è stata la connessione:

Code:
# ifconfig -a
bnep0     Link encap:Ethernet  HWaddr 00:10:60:A5:BD:11
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:100 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11973 (11.6 Kb)  TX bytes:79 (79.0 b)

eth0      Link encap:Ethernet  HWaddr 00:10:5A:F4:9E:1A
          inet addr:10.10.0.1  Bcast:10.10.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:282 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26729 (26.1 Kb)  TX bytes:6036 (5.8 Kb)
          Interrupt:11 Base address:0xd400

eth1      Link encap:Ethernet  HWaddr 00:04:76:DC:72:A2
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2848 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2664258 (2.5 Mb)  TX bytes:299038 (292.0 Kb)
          Interrupt:5 Base address:0xd800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:69 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8793 (8.5 Kb)  TX bytes:8793 (8.5 Kb)

pan0      Link encap:Ethernet  HWaddr 00:10:60:A5:BD:11
          inet addr:10.10.1.1  Bcast:10.10.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:193 errors:0 dropped:0 overruns:0 frame:0
          TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:20336 (19.8 Kb)  TX bytes:11689 (11.4 Kb)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:82.58.220.XXX  P-t-P:192.168.100.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:2609 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2022 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:2591433 (2.4 Mb)  TX bytes:240154 (234.5 Kb)


(qui evidentemente ci deve essere un errore, perchè l'interfaccia ppp0 contiene il parametro 192.168.100.1 che è il vecchio ip del server....)


controlliamo il bridge:

Code:
# brctl show
bridge name     bridge id               STP enabled     interfaces
pan0            8000.001060a5bd11       no              bnep0


e la connessione:

Code:
# pand --show
bnep0 00:10:60:A6:A2:D4 NAP


Ora bisogna configurare il firewall, ho usato shorewall perchè mi sembrava più facile rispetto a iptables nodo e crudo.

Nel link che ho riportato prima viene spiegata proprio una rete con 3 interfacce, è anche possibile scaricare un file con le configurazioni di base che vanno eventualmente modifcate, queste sono le mie impostazioni:

Code:
 # cat /etc/shorewall/zones | grep -ve "#"
net     Net             Internet
lan     Lan             Local Wired Networks
pan     Pan             Bluetooth Networks


Code:
# cat /etc/shorewall/interfaces | grep -ve "#"
net     ppp0            detect          dhcp,routefilter,norfc1918
lan     eth0            detect          dhcp
pan     pan0            detect


Code:
# cat /etc/shorewall/policy | grep -ve "#"
lan             net             ACCEPT
fw              net             ACCEPT
pan             net             ACCEPT
net             all             DROP            info
all             all             REJECT          info


Code:
 # cat /etc/shorewall/shorewall.conf | grep -ve "#"

STARTUP_ENABLED=Yes


LOGFILE=/var/log/messages


LOGFORMAT="Shorewall:%s:%s:"


LOGTAGONLY=No


LOGRATE=10/minute
LOGBURST=5


LOGALLNEW=


BLACKLIST_LOGLEVEL=


LOGNEWNOTSYN=info


MACLIST_LOG_LEVEL=info


TCP_FLAGS_LOG_LEVEL=info


RFC1918_LOG_LEVEL=info



SMURF_LOG_LEVEL=info


BOGON_LOG_LEVEL=info


LOG_MARTIANS=No


IPTABLES=


PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin


SHOREWALL_SHELL=/bin/sh


SUBSYSLOCK=/var/lock/subsys/shorewall


STATEDIR=/var/lib/shorewall


MODULESDIR=


CONFIG_PATH=/etc/shorewall:/usr/share/shorewall


RESTOREFILE=



FW=fw


IP_FORWARDING=On


ADD_IP_ALIASES=Yes


ADD_SNAT_ALIASES=No


RETAIN_ALIASES=No


TC_ENABLED=No


CLEAR_TC=Yes


MARK_IN_FORWARD_CHAIN=No


CLAMPMSS=yes



ROUTE_FILTER=No


DETECT_DNAT_IPADDRS=No


MUTEX_TIMEOUT=60


NEWNOTSYN=Yes


ADMINISABSENTMINDED=Yes


BLACKLISTNEWONLY=Yes


DELAYBLACKLISTLOAD=No


MODULE_SUFFIX=


DISABLE_IPV6=Yes


BRIDGING=No


DYNAMIC_ZONES=No


PKTTYPE=Yes


DROPINVALID=No


RFC1918_STRICT=No


MACLIST_TTL=


SAVE_IPSETS=No


BLACKLIST_DISPOSITION=DROP


MACLIST_DISPOSITION=REJECT


TCP_FLAGS_DISPOSITION=DROP



Ora dovreste poter navigare in internet sia via client windows/linux via ethernet o via bluetooth... ora ci sono da configurare i servizi, cioè la stampante e samba...






--------------per ora mi fermi qui, più tardi continuo---------------- :D
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