wariacje na temat konfiguracji sieci w OpenWrt
Ostatnia zmiana: 2015-04-12 19:01

W przedstawionych konfiguracjach brakuje sekcji lo, switch oraz kompletnej zawartości sekcji wifi-device. Należy je uzupełnić stosowanie do posiadanego sprzętu.

Założenia:
- lan: eth1
- wan: eth0
- wlan: kanał 5, kodowanie wpa2/aes
            dla trybu AP: hasło 1234567890, ssid: eko_one_pl
            dla trybu APClient: hasło 0987654321, ssid: ISP

Tryb AP

/etc/config/network



    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

    config interface wan
        option ifname   eth0
        option proto    dhcp

/etc/config/wireless



    config wifi-device radio0
        option type mac80211
        option channel 5
        option macaddr xx:xx:xx:xx:xx:xx
        option hwmode 11ng
        option htmode HT20

    config wifi-iface
        option device radio0
        option network lan
        option mode ap
        option ssid eko_one_pl
        option encryption psk2
        option key 1234567890

Włączenie 40MHz szerokości kanałów:


        list ht_capab HT40+
        list ht_capab HT40-


Tryb APClient (WISP)

/etc/config/network



    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

    config interface wan
        option ifname   eth0
        option proto    dhcp

/etc/config/wireless



    config wifi-device radio0
        option channel 5
        ...

    config wifi-iface
        option device radio0
        option network wan
        option mode sta
        option ssid ISP
        option encryption psk2
        option key 0987654321

Tryb AP + APClient

/etc/config/network



    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

    config interface wan
        option proto    dhcp

/etc/config/wireless



    config wifi-device radio0
        option channel 5
        ...

    config wifi-iface
        option device radio0
        option network lan
        option mode ap
        option ssid eko_one_pl
        option encryption psk2
        option key 1234567890

    config wifi-iface
        option device radio0
        option network wan
        option mode sta
        option ssid ISP
        option encryption psk2
        option key 0987654321

Tryb AP + VAP

Dodatkowy wirtualny AP z innym kodowaniem.

/etc/config/network



    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

    config interface wan
        option ifname   eth0
        option proto    dhcp

/etc/config/wireless



    config wifi-device radio0
        option channel 5
        ...

    config wifi-iface
        option device radio0
        option network lan
        option mode ap
        option ssid eko_one_pl_z_wpa2
        option encryption psk2
        option key 1234567890

    config wifi-iface
        option device radio0
        option network lan
        option mode ap
        option ssid eko_one_pl_z_wep
        option encryption wep
        option key 1
        option key1 2345678901

Tryb WDS

Jest to inny tryb niż spotykany w Broadcomach WET, tutaj występuje jako AP+STA-WDS (4-address frame).

AP

/etc/config/network


    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

    config interface wan
        option ifname   eth0
        option proto    dhcp

/etc/config/wireless


    config wifi-device  radio0
        option channel  5
        ...

    config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     test_wds
        option encryption psk2
        option key      1234567890
        option wds      1

Klient

Należy wyłączyć dhcp:


    # /etc/init.d/dnsmasq disable
    # /etc/init.d/dnsmasq stop

/etc/config/network


    config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.2.1
        option netmask  255.255.255.0

/etc/config/wireless

 
    config wifi-device  radio0
        option channel  5
        ...

    config wifi-iface
        option device   radio0
        option network  lan
        option mode     sta
        option ssid     test_wds
        option encryption psk2
        option key      1234567890
        option wds      1

Komputery podłączone kablem do klienta uzyskają adres 192.168.1.x, czyli z serwera dhcp na AP. Adres na kliencie ustawiony jest z innej puli tylko żeby można było się do niego podłączyć w razie potrzeby.

Bridged Client

Bridged Client