Kablosuz Ağlar

$FreeBSDMall: doc/en_US.ISO8859-1/articles/wireless/article.sgml,v 1.13 2005/09/27 03:57:58 murray Exp $


İçerik
1 Kablosuz ağ temelleri
2 Basit ayarlar
3 Erişim noktalı bağlantı (Infrastracture mode)
4 Erişim notkası olmadan bağlantı (ad-hoc mode)
5 Çıkabilecek sorunlar ve çözümleri

1 Kablosuz ağ temelleri

Kablosuz ağlar IEEE 802.11 standartını temel almaktadırlar. Basit bir kablosuz ağ birbirleriyle 2.4GHz veya 5GHz bant genişliğinde haberleşen istemcilerden oluşur. Gerçi bu bant genişlikleri ülkelere göre değişiklikler gösterir ayrıca değişik kablosuz ağların aynı yerde olabileceği düşünülerek bu frekeanslar değişim göstermektedir.

802.11 ağları iki şekilde çalışabilir. Bunlardan ilki BSS (Basic Service Set) adı verilen birden fazla istemcinin bir ana istasyon üzerinden bağlandığı yöntemdir. Bu bağlantı şekline Erişim noktalı bağlantı veya noktadan çok noktaya bağlantı denmektedir. İngilizcesi Infrastructure mode adı verilen bu yöntemde bütün trafik erişim noktası (EN) adı verilen cihazlardan geçer. Bir istemci direk karşı taraf ile konuştuğunu zanneder fakat bütün trafik EN üzerinden geçer. İkinci yöntem ise noktadan notkaya adı verilen ortamda herhangi bir erişim noktası olmadan haberleşmektir. Bu yönteme IBSS (Independent Basic Service Set) adı verilir. Bu yöntemin ingilizce adı ad-hoc mode'tur.

802.11 ağları ilk başta 2.4GHz bant genişliğini kullanarak tasarlanmıştır. Bu standart IEEE 802.11b ile tanıtılmıştır. Bu standart içinde çalışma frekansları, MAC katmanı adı verilen çerçeveleme ve iletim oranlarının belirlendiği katmanlar vardır. İlk standarttan sonra 802.11a verilen ve 5Ghz 'de haberleşmenin yapıldığı, değişik sinyalleşme teknolojilerinin kullanıldığı ve daha yüksek bant genişliği sunan ikinci standart ortaya çıkmıştır. Daha sonra 802.11g adı verilen ve 802.11a 'da kullanılan sinyal ve iletim teknolojilerinin 2.4Ghz 'de de kullanılabildiği ve 802.11b ile tamamen uyumlu yeni bir standart ortaya konulmuştur.

 802.11 'nin sunduğu iletişim teknolojilerinden ayrı olarak kablosuz yerel alan ağları için değişik güvenlik yöntemleri geliştirilmiştir. Orjinal  802.11 standartı WEP adı verilen basit bir güvenlik teknolojisini içerir. WEP daha önceden her iki tarafın bildiği paylaşımlı bir anahtarın kullanılması ve şifrelemenin RC4 tekniği ile yapıldığı bir teknolojidir. WEP'in son derece güvensiz bir şifreleme yöntemi olduğu ve kırıldığı için alternatif şifreleme yöntemleri geliştirilmiştir. Bu yeni şifreleme teknikleri IEEE 802.11i ile tanımlanmakta ve tamamamen farklı şifreleme protokolleri (AES) kullanılmaktadır. Ayrıca kimlik doğrulama için yeni yöntemler geliştirilmiştir. Ek olarak anahtar değiş tokuşu farklı yöntemler ile yapılmaktadır. Bu yöntem ile şifreleme anahtarları periyodik olarak değiştirilmektedir ve de sızma işlemlerini tespit için değişik yöntemler kullanılmaktadır. Bir diğer protokol ise WPA adı verilen ve sektördeki birkaç organizasyon tarafından IEEE 802.11i çıkmadan önce IEEE 802.11i 'ye geçilmesi için ara katmanı oluşturuan protokoldür. WPA, IEEE 802.11i standartının sadece belirli kısımlarını içerir ve bu standartların mevcut donanımlar üzerinde çalışmasını sağlar. WPA, WEP protokolünden üretilen TKIP adlı protokolü kullanır.IEEE 802.11i standartı TKIP kullanılmasına izin verse de istasyonlar arası haberleşmenin AES ile yapılmasını gerektirir. Fakat AES mevcut kablosuz alan ağları donanımları için oldukça karmaşık bir yöntemdir. Bu yüzden WPA günümüzde yoğun olarak kullanılmaktadır.

Üstte belirtilen protokollere ek olarak 802.11e adı verilen bir standartta mevcuttur. Bu protokol 802.11 ağları üzerinden multimedya ve VoIP görüşmelerinin yapılabilmesi için gerekli protoldür. 802.11i de olduğu gibi  802.11e yerine günümüzde WME (ve de WMM) adı verilen ve ara katman bir protok kullanılmaktadır. WME veya 802.11e protokolleri trafik önceliklendirme yapabilecektir. Böylece multimedya uygulamalarının aksamasız çalışması sağlanacaktır.

FreeBSD 6.0 802.11a, 80.211b, 802.11, WPA ve 802.11i protokollerini desteklemektedir. Ayrıca  WME/WMM protokolleri bazı arabirimler için de desteklenmektedir.

 


2 Basit Ayarlar

2.1 Çekirdek Ayarları

Kablosuz ağı kullanabilmeniz için ilk olarak kablosuz ağ arabirimine ihtiyacınız vardır. Kablosuz arabirimini bulduktan sonra çekirdeğinizde ilgili kablosuz ağ kartı sürücüsünün olması gerekir. Bunun için çekirdek yapılandırma dosyasında birkaç ayar yapılması gerekir.

Burada verilen örnekte kullanımı çok yaygın olan Atheros kablosuz ağ arabirimi anlatılacaktır. Bu çipi kullanan kartlar ath sürücüsü ile tanıtılır. Bu kart için şu satırların çekirdek yapılandırma dosyasında olması gerekir:

device ath               # Atheros IEEE 802.11 wireless network driver
device ath_hal           # Atheros Hardware Access Layer
device ath_rate_sample   # John Bicket's SampleRate control algorithm.

Atheros sürcüsü birden fazla bileşenden oluşmaktadır. Bunlar ath adı verilen sürücü, çip ile alakalı fonskiyonların kotarılmsını sağlayan donanım destek katmanı sürücüsü (ath_hal) ve değişik frekanslar arası geçişi sağlayan ath_rate_sample sürücüsüdür.

Prism çipli kartlar için wi, Intel Centrino kartlar için ipw veya iwi, Cisco kartlar için an, Ralink çipli kartlar için ral sürücüleri kullanılır.

Bu işlemden sonra 802.11 kablosuz alan ağı desteğini çekirdeğinize eklemelisiniz:

device wlan              # 802.11 support (Required)

Bütün bunlardan sonra şifreleme fonksiyonlarını yerine getiren sürücülerin de çekirdeğinizde olması gerekir. Kullanılabilecek şifreleme modülleri:

device wlan_wep          # WEP crypto support for 802.11 devices
device wlan_ccmp         # AES-CCMP crypto support for 802.11 devices
device wlan_tkip         # TKIP and Michael crypto support for 802.11 devices

wlan_ccmp ve wlan_tkip sürücüsüne WPA veya 802.11i kullanılacaksa ihtiyaç duyulur. WEP için wlan_wep kullanılır. Eğer herhangi bir şifreleme yöntemi kullanılmayacaksa üstte belirtilen sürücülerden herhangi birinin kullanılmasına gerek yoktur.

Bu sürücülerin yanında ayrıca sisteminizi EN (Erişim Noktası) olarak kullanacaksanız gerekli olan iki sürücü daha vardır. wlan_xauth sürücüsü kendine gelen kimlik doğrulama isteklerini hostpad gibi bir programa gönderir. wlan_acl ise MAC adreslerine göre bir sınırlama getirir. Her ne kadar MAC sınırlaması çok yararlı olmasa da kullanılabilecek bir güvenlik önlemidir.

device wlan_xauth        # External authenticator support for 802.11 devices
device wlan_acl          # MAC-based ACL support for 802.11 devices

Çekirdek yapılandırma dosyasınızdaki bu sürücü ve ayarlar girildikten sonra çekirdeğinizi tekrar derlemeniz gerekmektedir. Veya çekirdeğinizi tekrar derlemek istemiyorsanız ilgili modülleri yüklemeniz gerekir.

 


2.2 Kablosuz şifreleme modüllerinin yüklenmesi

# vi /boot/loader.conf
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
wlan_xauth_load="YES"
wlan_acl_load="YES"

Note: İhtiyacınız olan şifreleme sürücülerini ya loader.conf dosyasına yazarak ya da çekirdeğin içine gömerek elde edebilirsiniz. Bu çekirdek modülleri elle ayarlanmalıdır çünkü çekirdek henüz bu modülleri dinamik olarak yükleme kabiliyetine sahip değildir.

 

Sistem açıldığında kartınızın tanınması durumunda aşağıdaki gibi mesajlarla karşılaşmanız gerekmektedir:

ath0: <Atheros 5212> mem 0xff9f0000-0xff9fffff irq 17 at device 2.0 on pci2
ath0: Ethernet address: 00:11:95:d5:43:62
ath0: mac 7.9 phy 4.5 radio 5.6

3 Erişim noktalı bağlantı (Infrastracture mode)
 

3.1 FreeBSD İstemciler

3.1.1 Erişim Noktalarının tesbiti

Etrafınızda var olan EN'lerin tesbiti için ifconfig komutu kullanılır. Bu tarama sadece root kullanıcısı tarafından yapılabilir:

# ifconfig ath0 up scan
dlinkap         00:13:46:49:41:76    6   54M 29:0   100 EPS  WPA WME
freebsdap       00:11:95:c3:0d:ac    1   54M 22:0   100 EPS  WPA

EN 'in kabiliyetlerine göre scan komutu çıktısında şu bayraklar ile karşılaşabiliriz:

Depending on the capabilities of the APs, the following flags can be included in the output:

E

Extended Service Set (ESS). Erişim noktalı bağlantının aktif olduğunu gösterir.

I

IBSS/ad-hoc olarak adlandırılan erişim noktası olmadan olan bağlantıdır.

P

BSS içerisinde gönderilen bilgilerin şifreleme yapılarak gönderilmesi gerektiğini belirtir. Kullanılabilecek protokoller WEP,TKIP veya AES-CCMP'dir.

 

S

Ağın kısa başlangıç (Short Preamble) modunu kullandığını gösterir. Bu protokol 802.11b High Rate/DSSS PHY ile tanımlanmış ve 128 bit senkronize paketleri yerine 56 bit senkronize paketi kullanıldığını gösterir.

 

s

Ağın kısa slot zamanını kullandığını gösterir.

list scan: Bu komut ile ağdaki EN veya ad-hoc bağlantıları listeler. Bu bilgi otomatik olarak güncellenebileceği gibi "scan" komutu ile de güncellenebilir. Bu komuta ek olarak  "list ap" komutu da kullanılabilir.

 


3.1.2 Basit Ayarlar

Bu bölümde FreeBSD ile kablosuz bir bağlantının şifresiz olarak nasıl yapılacağı anlatılacaktır. Aşağıda belirtilen kavramları anladıktan sonra WPA protokolünü kullanmanız şiddetle tavsiye edilir.

 


3.1.2.1 DHCP

/etc/rc.conf  dosyasını şu şekilde düzenleyin:

ifconfig_ath0="DHCP"

Eğer ortamda birden fazla EN varsa bağlanmak istediğiniz kablosuz ağın SSID'sini şu şekilde belirtin:

ifconfig_ath0="ssid SSID_ADI DHCP"

Bağlantıyı sağlamak için  şu komutu verin:

# /etc/rc.d/netif start

3.1.2.2 Statik IP Adres

Statik bir IP adresi almak için ortamda birden fazla EN varsa şu komut çalıştırılır:

# ifconfig ath0 inet 192.168.1.100 netmask 255.255.255.0 ssid your_ssid_here

ifconfig komutu ath0 için çalıştırılırsa:

# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
        status: associated
        ssid dlinkap channel 6 bssid 00:13:46:49:41:76
        authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

3.1.3 WPA

WPA (Wi-Fi Protected Access) basitçe TKIP + 802.1X olarak gösterilebilir. TKIP (Temporary Key Integrity Protocol) 802.11i standardının bir parçasıdır ve WEP 'in dizayn hatalarını kapatmak için geliştirilimiştir.

RSN (WPA2), TKIP yerine  CCMP (Counter Mode with CBC-MAC Protocol) kullanır.


3.1.3.1 WPA-PSK

Önceden paylaşılmış anahtar (PSK) sizin tarafınızdan önceden belirtilmiş bir şifreden üretilir ve kablosuz ağda şifrelemenin yapılacağı başlangıç anahtarı olarak kullanılır.

Warning: Her zaman sağlam bir şifre kullanın. Böylece sözlük saldırılarına karşı daha savunmalı olursunuz..

# vi /etc/wpa_supplicant.conf

network={
    ssid="freebsdap"
    psk="freebsdmall"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...

Şimdi arabirimi aktive edelim:

# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.1
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
        protmode CTS roaming MANUAL bintval 100

Veya bağlantıyı elle sağlayalım:

Üstte belirtilen /etc/wpa_supplicant.conf dosyası ile aynı dosya kullanılarak:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=TKIP GTK=TKIP]

Daha sonra IP almak için:

# dhclient ath0
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds.

# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/48Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
        protmode CTS roaming MANUAL bintval 100

Note: Eğer /etc/rc.conf şu şeklinde ayarlanmış ise

ifconfig_ath0="DHCP"
dhclient komutunun elle verilmesine gerek yoktur. wpa_supplicant programı başarılı bir şekilde çalışmış ise dhclient komutu otomatik olarak çalıştırılacaktır.

Şu komutlarla istediğiniz bir IP'yi statik olarak alabilirsiniz.

# ifconfig ath0 inet 192.168.0.100 netmask 255.255.255.0

# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
        protmode CTS roaming MANUAL bintval 100

          # route add default your_default_routeer

          # echo "nameserver your_DNS_server" >> /etc/resolv.conf

3.1.3.2 EAP-TLS
# vi /etc/wpa_supplicant.conf

network={
    ssid="freebsdap"
    proto=RSN
    key_mgmt=WPA-EAP
    eap=TLS
    identity="loader"
    ca_cert="/etc/certs/cacert.pem"
    client_cert="/etc/certs/clientcert.pem"
    private_key="/etc/certs/clientkey.pem"
    private_key_passwd="freebsdmallclient"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

Ayrıca arabirimi elle aktive etmek için:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.3.3 EAP-TTLS
# vi /etc/wpa_supplicant.conf

network={
    ssid="freebsdap"
    proto=RSN
    key_mgmt=WPA-EAP
    eap=TTLS
    identity="test"
    password="test"
    ca_cert="/etc/certs/cacert.pem"
    phase2="auth=MD5"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

 ... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

Ayrıca arabirimi elle aktive etmek için:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.3.4 EAP-PEAP
# vi /etc/wpa_supplicant.conf

network={
    ssid="freebsdap"
    proto=RSN
    key_mgmt=WPA-EAP
    eap=PEAP
    identity="test"
    password="test"
    ca_cert="/etc/certs/cacert.pem"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

Ayrıca arabirimi elle aktive etmek için:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
EAP-MSCHAPV2: Authentication succeeded
EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.4 WEP

WEP (Wired Equivalent Privacy) orjinal 802.11 standartının bir parçasıdır. WEP'te kimlik doğrulama için herhangi bir yöntem yoktur. Sadece basit bir erişim kontrol mekanızması vardır. 

İlk başta  “device wlan_wep” sürücünüzün çekirdeğinizde olduğundan veya modül olarak  “kldload wlan_wep.ko” komutu ile yüklendiğinden emin olunç

# ifconfig ath0 inet 192.168.1.100 netmask 255.255.255.0 ssid dlinkap \ 
          wepmode on weptxkey 3 wepkey 3:0x3456789012
# ifconfig
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
        status: associated
        ssid dlinkap channel 6 bssid 00:13:46:49:41:76
        authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
        protmode CTS bintval 100
  •  “weptxkey” hangi WEP anahtarının kullanıldığı belirtilir. Örneğimizde 3. WEP anahtarı kullanılmaktadır.

  • “wepkey” ile kullanacağımız anahtar belirtilir. Bu komut  numara:anahtar şeklinde olmalıdır. Eğer numara verilmez ise ilk anahtar kullanılır.

Ek olarak wpa_supplicant kullanarak, WEP kullanmak üzere ayarlanmış bir EN'ye bağlanılabilir.

Örnek olarak:

# vi /etc/wpa_supplicant.conf

network={
    ssid="dlinkap"
    key_mgmt=NONE
    wep_key2=3456789012
    wep_tx_keyidx=2
}
# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:13:46:49:41:76 (SSID='dlinkap' freq=2437 MHz)
Associated with 00:13:46:49:41:76

3.2 FreeBSD Erişim Notkası

FreeBSD aynı zamanda EN olarak'ta kullanılabilir. Ayrıca  hostapd  ile WPA desteği de sunar.


3.2.1 Bilgisayar tabanlı EN

EN tarafında:

# ifconfig ath0 inet 192.168.0.120 netmask 255.255.255.0 ssid freebsdap mode 11g mediaopt hostap
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.120 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 
        ether 00:11:95:c3:0d:ac
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode OPEN privacy OFF txpowmax 36 protmode CTS dtimperiod 1
        bintval 100

İstemci tarafında

# ifconfig ath0 up scan
SSID            BSSID              CHAN RATE  S:N   INT CAPS
freebsdap       00:11:95:c3:0d:ac    1   54M 19:0   100 ES  
dlinkap         00:13:46:49:41:76    6   54M 30:0   100 EPS  WPA WME
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 ssid freebsdap
# ifconfig -v ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

3.2.2 WEP:

EN tarafında:

# ifconfig ath0 inet 192.168.0.120  netmask 255.255.255.0 ssid freebsdap \
        wepmode on weptxkey 3 wepkey 3:0x3456789012 mode 11g mediaopt hostap
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.120 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 
        ether 00:11:95:c3:0d:ac
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
        protmode CTS dtimperiod 1 bintval 100

İstemci tarafında

# ifconfig ath0 up scan
SSID            BSSID              CHAN RATE  S:N   INT CAPS
freebsdap       00:11:95:c3:0d:ac    1   54M 20:0   100 EPS 
dlinkap         00:13:46:49:41:76    6   54M 30:0   100 EPS  WPA WME
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 ssid freebsdap \
        wepmode on weptxkey 3 wepkey 1:0x3456789012
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
        protmode CTS roaming DEVICE bintval 100

3.2.3 WPA-PSK

Host tarafında:

# vi /etc/hostapd.conf

interface=ath0
driver=bsd
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=freebsdap
wpa=1
wpa_passphrase=freebsdmall
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP

Daha sonra şu komut çalıştırılır:

# /usr/sbin/hostapd /etc/hostapd.conf
# ifconfig ath0 mediaopt hostap

İstemci tarafında

# ifconfig ath0 up scan
dlinkap         00:13:46:49:41:76    6   54M 29:0   100 EPS  WPA WME
freebsdap       00:11:95:c3:0d:ac    1   54M 22:0   100 EPS  WPA
# vi /etc/wpa_supplicant

network={
     ssid="freebsdap"
     psk="freebsdmall"
}

Daha sonra şu komut çalıştırılır:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
   
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0
# ifconfig -v ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit
        txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.2.4 EAP-TLS:

 

# vi /etc/hostapd.conf

interface=ath0
driver=bsd
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=freebsdap
ieee8021x=1
own_ip_addr=127.0.0.1
auth_server_addr=127.0.0.1
auth_server_port=1812
auth_server_shared_secret=freebsdmallradius
wpa=2
wpa_key_mgmt=WPA-EAP
wpa_pairwise=CCMP TKIP

Aynu sunucuda  net/freeradius kurulduktan sonra:

# vi /usr/local/etc/raddb/clients.conf

client 127.0.0.1 {
     secret= freebsdmallradius
     shortname= localhost
}
# vi /usr/local/etc/raddb/users

"loader"     Auth-Type := EAP
# vi /usr/local/etc/raddb/eap.conf

eap {
      default_eap_type = tls
      timer_expire     = 60
      ignore_unknown_eap_types = no
      cisco_accounting_username_bug = no
      md5 {
      }
      leap {
      }
      gtc {
      auth_type = PAP
      }
      tls {
      private_key_password = freebsdmallserver
      private_key_file = /home/loader/radius/serverkey.pem
      certificate_file = /home/loader/radius/servercert.pem
      CA_file = /home/loader/radius/CA_nlab/cacert.pem
      dh_file = ${raddbdir}/certs/dh
      random_file = /dev/urandom
      fragment_size = 1024
      }
      mschapv2 {
      }
}
# /usr/local/etc/rc.d/radiusd.sh start
# hostapd /etc/hostapd-eap-tls.conf
   
# ifconfig ath0 mediaopt hostap
# ifconfig ath0 
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2290
        inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:c3:0d:ac
        media: IEEE 802.11 Wireless Ethernet autoselect <:hostap> (autoselect <hostap>)
        status: associated
        ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
        authmode WPA2/802.11i privacy MIXED deftxkey 2 TKIP 2:128-bit
        TKIP 3:128-bit txpowmax 0 protmode CTS dtimperiod 1 bintval 100

İstemci tarafında:

# wpa_supplicant -d -K -i ath0 -c /etc/wpa_supplicant.conf
   

3.2.5 EAP-TTLS

EPA-TLS  ile aynı /etc/hostapd.conf dosya kullanıldıktan sonra:

# vi /usr/local/etc/raddb/eap.conf

eap {
      default_eap_type = ttls
      timer_expire     = 60
      ignore_unknown_eap_types = no
      cisco_accounting_username_bug = no
      md5 {
      }
      leap {
      }
      gtc {
          auth_type = PAP
      }
      tls {
          private_key_password = freebsdmallserver
          private_key_file = /home/loader/radius/serverkey.pem
          certificate_file = /home/loader/radius/servercert.pem
          CA_file = /home/loader/radius/CA_nlab/cacert.pem
          dh_file = ${raddbdir}/certs/dh
          random_file = /dev/urandom
          fragment_size = 1024
      }
      ttls {
          default_eap_type = md5
      
      }
      mschapv2 {
      }
}
# vi /usr/local/etc/raddb/users

"test" User-Password == "test"
# hostapd /etc/hostapd.conf

İstemci tarafında:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf

3.2.6 EAP-PEAP

EN tarafında:

EPA-TLS  ile aynı /etc/hostapd.conf dosya kullanıldıktan sonra:

# vi /usr/local/etc/raddb/eap.conf

eap {
      default_eap_type = peap
      timer_expire     = 60
      ignore_unknown_eap_types = no
      cisco_accounting_username_bug = no
      md5 {
      }
      leap {
      }
      gtc {
          auth_type = PAP
      }
      tls {
          private_key_password = freebsdmallserver
          private_key_file = /home/loader/radius/serverkey.pem
          certificate_file = /home/loader/radius/servercert.pem
          CA_file = /home/loader/radius/CA_nlab/cacert.pem
          dh_file = ${raddbdir}/certs/dh
          random_file = /dev/urandom
          fragment_size = 1024
      }
          
      peap {
          default_eap_type = mschapv2
      }
      mschapv2 {
      }
}

/usr/local/etc/raddb/users:

# vi /usr/local/etc/raddb/users

"test" User-Password == "test"
# hostapd /etc/hostapd.conf

İstemci tarafında:

# wpa_supplicant -d -i ath0 -c /etc/wpa_supplicant.conf
   

4 Ad-hoc mode

A istemcisi:

# ifconfig ath0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mediaopt adhoc

# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 
        ether 00:11:95:c3:0d:ac
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>)
        status: associated
        ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac
        authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

B İstemcisi:

# ifconfig ath0 up scan
SSID            BSSID              CHAN RATE  S:N   INT CAPS
dlinkap         00:13:46:49:41:76    6   54M 30:0   100 EPS  WME
freebsdap       02:11:95:c3:0d:ac    2   54M 19:0   100 IS
# ifconfig ath0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap mediaopt adhoc

# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 
        inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:11:95:d5:43:62
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>)
        status: associated
        ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac
        authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

5 Çıkabilecek Sorunlar ve Çözümleri:

Eğer kablosuz bağlantı kurmaya çalışırken problem ile karşılaşıyorsanız:


This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <[email protected]>.
For questions about this documentation, e-mail <[email protected]>.