Új hozzászólás Aktív témák

  • Csicsóka
    őstag

    A következő a felállás:

    Lubuntu 10.10 rendszer, mert a szerver egyben media központ is (XBMC), és netezésre is használom olykor. Gsejt lap 32 GB SSD, 1TB HDD.

    eth0 dhcp-vel, ide jön a kábelmodem.
    eth1 gigabit belső hálózat
    wlan0 wifi AP mode, ath5k modullal, hostapd-vel

    A klasszikus megoldás, amit ezen a fórumon, és itt, ésitt olvasható a 10.10-en egyszerűen nem működik, mert létre sem jön a br0, és így persze ip-t sem kap.
    innentől kezdve meg már nem is megy a hostapd, tehát nuku master mode.
    A bridge-t a bridge utils utasításaival kell létre hozni, ami így néz ki:

    brctl addbr br0
    brctl addif br0 eth1
    invoke-rc.d hostapd start
    brctl addif br0 wlan0
    brctl setfd br0 0

    ifconfig eth1 up
    ifconfig wlan0 up
    ifconfig br0 10.1.1.1 up

    invoke-rc.d dhcp3-server start

    A hostapd, és a dhcp server persze ki van véve a 2-es futási szintből, mert innen indulnak.

    A port forward és maskolás ez:

    echo 1 > /proc/sys/net/ipv4/ip_forward

    iptables -t nat -A POSTROUTING -s 10.1.1.0/24 -o eth0 -j MASQUERADE
    iptables -A FORWARD -s 10.1.1.0/24 -o eth0 -j ACCEPT
    iptables -A FORWARD -d 10.1.1.0/24 -m conntrack --ctstate ESTABLISHED,RELATED -i eth0 -j ACCEPT

    Ez az egész egyébként az /etc/rc.local-ban van.

    Mivel a bridge nem a interfaces-ben van ezért ez csak egyszerűen ilyen:

    root@lubuntu-server:/etc# cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface

    auto eth0
    iface eth0 inet dhcp

    # The secondary network interface

    auto eth1
    iface eth1 inet manual

    #Wireless Setup

    auto wlan0
    iface wlan0 inet manual

    root@lubuntu-server:~# cat /etc/hostapd/hostapd.conf
    #wireless interface to use as AP
    interface=wlan0

    #bridge device (needed for madwifi & nl80211 drivers)
    bridge=br0

    #driver interface type (hostapd/wired/madwifi/prism54/test/none/nl80211/bsd)
    # Use nl80211 for wifi drivers that implement MAC80211 interface
    #You should set this to your relevant driver interface type
    driver=nl80211
    #ieee80211n=1

    #Enables logging to standard output (useful for debugging)
    logger_stdout=-1
    logger_stdout_level=2

    #Set SSID to use
    ssid=UBUNTU_SERVER

    # Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)
    # note your card may not support every mode.
    hw_mode=g

    #Channel to use (1-13)
    channel=6

    # IEEE 802.11 specifies two authentication algorithms. hostapd can be
    # configured to allow both of these or only one. Open system authentication
    # should be used with IEEE 802.1X.
    # Bit fields of allowed authentication algorithms:
    # bit 0 = Open System Authentication
    # bit 1 = Shared Key Authentication (requires WEP)
    auth_algs=3

    #maximum number of stations (clients connecting to AP) allowed
    # Maximum number of stations allowed in station table. New stations will be
    # rejected after the station table is full. IEEE 802.11 has a limit of 2007
    # different association IDs, so this number should not be larger than that.
    max_num_sta=5

    #Enable WPA2
    # This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0)
    # and/or WPA2 (full IEEE 802.11i/RSN):
    # bit0 = WPA
    # bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled)
    wpa=2

    #Set passphrase for WPA
    wpa_passphrase=**********
    wpa_key_mgmt=WPA-PSK

    # Set of accepted cipher suites (encryption algorithms) for pairwise keys
    # (unicast packets). This is a space separated list of algorithms:
    # CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
    # TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
    # Group cipher suite (encryption algorithm for broadcast and multicast frames)
    # is automatically selected based on this configuration. If only CCMP is
    # allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise,
    # TKIP will be used as the group cipher.
    # (dot11RSNAConfigPairwiseCiphersTable)
    # Pairwise cipher for WPA (v1) (default: TKIP)
    wpa_pairwise=TKIP CCMP
    # Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value)
    rsn_pairwise=CCMP

    A dhcp server a br0-ra dolgozik.

    Így megoldva minden szép, van br0 ip-vel, megy a hostapd, tökéletesen működik minden, (ping, ssh, ftp) kivéve az smb-t.

    Ez a samba conf tökéletesen működik ha nincs a rendszerben bridge.

    root@lubuntu-server:~# ls /etc/samba
    dhcp.conf gdbcommands smb.conf smb.conf.ucf-dist
    root@lubuntu-server:~# cat /etc/samba/smb.conf
    [global]
    netbios name = UBUNTU-SERVER
    guest account = nobody
    guest ok = yes
    local master = yes
    workgroup = WORKGROUP
    os level = 66
    security = share
    max log size = 1024
    read only = no
    # interfaces = br0
    # bind interfaces only = true

    [Nas]
    comment = Halozati meghajto
    path = /media/Nas/Megoszt
    browseable = Yes
    writeable = Yes
    guest ok = Yes

    Ünnep után feldobok egy koala-t, v jaunti-t mert még ezekben biztos h ment rendesen minden. A neten olvasgatva ebben a témában, a 10.10-el másnak is volt baja.

Új hozzászólás Aktív témák