Changes between Version 61 and Version 62 of WikiStart


Ignore:
Timestamp:
May 17, 2013, 2:41:37 PM (12 years ago)
Author:
walter
Comment:

2 server volgens handleiding nagebouwd en klopt nu, 1 AP's nagebouwd volgens handleiding en zou nu ook moeten kloppen?

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v61 v62  
    148148
    149149touch customize/sbin/wifi-update
     150touch customize/sbin/openvpn-update
    150151touch customize/usr/sbin/iopenvpn
    151152
     
    179180config dhcp lan #! I doubt this one is even used... <---
    180181        option interface        lan
    181         option start    100
    182         option limit    150
    183         option leasetime        12h
     182        option ignore   1
     183#!      option start    100
     184#!      option limit    150
     185#!      option leasetime        12h
    184186
    185187config dhcp wan
     
    357359        option ifname   wlan0
    358360        option type     bridge
     361#       option proto    dhcp #!TODO by this the AP's also get a real dhcp lease from the server, mac prefix range?
     362       
    359363
    360364#!Add this interface if you internally NAT/Route the 2nd multiSSID instead of bridge <---
     
    372376        option  hostname  eduroam-bullet #!Unique name differ! <---
    373377        option  timezone  CET-1CEST,M3.5.0,M10.5.0/3 #!correct timezone Amsterdam Netherlands <---
    374         option  log_ip    192.168.4.100 #! destination of syslog-ng server <---
     378        option  log_ip    192.168.4.1 #! destination of syslog-ng server <---
    375379        option  log_port  514       
    376380
     
    529533}}}
    530534
     535#example code# /sbin/openvpn-update
     536{{{
     537#!/bin/sh
     538
     539MAC=$(/sbin/wifi detect | /usr/bin/awk '/macaddr/ { print $3 }')
     540
     541/bin/sed -i "s/MACADDRESS/$MAC/g" /etc/openvpn/client.conf
     542}}}
     543
    531544#example code# /usr/sbin/iopenvpn
    532545{{{
     
    547560}}}
    548561
     562#example code# /etc/openvpn/up.sh
     563{{{
     564#!/bin/sh
     565#tap interface in openvpn/kernel generates unique new MAC address!!!
     566#TODO don't understand how ip of AP for the tunnel is created/assigned?
     567#Multiple AP devices work, but may conflict with dhcplease range of wireless clients?
     568#remove ${IP} and add proto dhcp to lan /etc/config/network
     569
     570FROM=3
     571TO=4
     572
     573brctl addif br-lan $1
     574IP=$(echo $4 | sed "s/\.$FROM\./\.$TO\./g" )
     575ifconfig br-lan ${IP} up
     576echo "Using: $IP"
     577}}}
     578
    549579Setup openvpn key/certificates/config for the AP, skip to section 3.2 of this howto when you don't have a *.tar file with keys&config for your individual unique AP, comeback if you have a *.tar and continue.
    550580
     
    558588{{{
    559589chmod +x customize/usr/sbin/iopenvpn
    560 
    561590chmod +x customize/sbin/wifi-update
    562 
    563591chmod +x customize/etc/init.d/sysntpd
    564 
    565592chmod +x customize/etc/init.d/openvpn
    566 
    567593chmod +x customize/etc/openvpn/up.sh
    568 
    569594chmod +x customize/etc/rc.local
    570 
    571595chmod +x customize/etc/firewall.user
    572 
    573596chmod +x customize/etc/inittab
    574597}}}
     
    582605ssh root@192.168.1.20
    583606
    584 ## enable openvpn
    585 chmod +x /usr/sbin/iopenvpn
    586 chmod +x /etc/openvpn/up.sh
     607## enable / activate at boottime openvpn
    587608/etc/init.d/openvpn enable
    588609
    589610## activate wifi to add MACadress to /etc/config/wireless file
    590 /sbin/wifi stop
     611#/sbin/wifi stop
    591612#/sbin/wifi start
    592613#/bin/sleep 5
    593614/sbin/wifi detect
    594615/bin/sleep 10
    595 chmod +x /sbin/wifi-update
    596616/sbin/wifi-update
    597617#/bin/sleep 5
    598 # check / correct following in chmod+x /etc /sbin /usr/sbin
    599618reboot;exit
    600619
    601620## done
    602621#check your working "eduroam" accesspoint!
    603 ##TODO check all execute writes on uploaded scripts!
    604622}}}
    605623
     
    845863default-lease-time 600;
    846864max-lease-time 7200;
     865#subnet 192.168.4.0 netmask 255.255.255.0 {
     866#       range 192.168.4.100 192.168.4.150;
     867#       option routers 192.168.4.1;
     868
     869#ap's different lease
     870class "ubntaps" {
     871        match if (substring (hardware, 1, 3) = DC:9F:DB);
     872}
     873
     874class "eduroamusers" {
     875        match if not (substring (hardware, 1, 3) = DC:9F:DB);
     876}
     877
    847878subnet 192.168.4.0 netmask 255.255.255.0 {
    848         range 192.168.4.100 192.168.4.150;
    849879        option routers 192.168.4.1;
     880
     881pool {
     882        allow members of "ubntaps";
     883        range 192.168.4.3 192.168.4.66;
     884}
     885
     886pool {
     887        allow members of "eduroamusers";
     888        range 192.168.4.150 192.168.4.250;
     889}
     890
     891}
     892
     893
    850894}
    851895}}}
     
    909953}}}
    910954
    911 To allow nat/routing and function as a local gateway/concentrator for the tunneld traffic from eduroam accesspoints (openvpn clients) the following config must be set once.
    912 {{{
    913 ## Allows forwarding
    914 cat /proc/sys/net/ipv4/ip_forward #shows current off state
     955To allow nat/routing and function as a local gateway/concentrator for the tunneld traffic from eduroam accesspoints (openvpn clients) the following config must be set every boot.
     956{{{
     957## add the following firewall masquerade code "quick and dirty" at the end of the rc.local file before exit0!
     958nano /etc/rc.local
     959}}}
     960
     961#example code# /etc/rc.local
     962{{{
     963
     964#enable forwarding at ip level
    915965echo "1" > /proc/sys/net/ipv4/ip_forward
    916 cat /proc/sys/net/ipv4/ip_forward #shows current on state ?
    917 
    918 ## add the following firewall masquerade code "quick and dirty" at the end of the file before exit0!
    919 nano /etc/rc.local
    920 }}}
    921 
    922 #example code# /etc/rc.local
    923 {{{
    924 #!/bin/sh
     966
     967#enable nat/routing from eth0
    925968/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    926 #/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
    927 #/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
     969
     970#enable nat/routing to eth0 directly
     971/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
     972/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
     973
     974#enable nat/routing to tap0 openvpn
    928975/sbin/iptables -A FORWARD -i eth0 -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
    929976/sbin/iptables -A FORWARD -i tap0 -o eth0 -j ACCEPT
     977
     978#before exit 0
    930979}}}
    931980
     
    10581107script-security 2
    10591108keepalive 10 180 #! these settings keep the tunnel alive on the W.L. network <---
     1109#! run /bin/openvpnupdate update before uncommenting lladdress
     1110#! lladdress MACADDRESS #! overides random MAC adress of the br-lan interface for controlled dhcp lease! <---
     1111
    10601112}}}
    10611113
     
    13091361        default AIROS reboot into tftp mode parameter 5.5.4 mtd cat /proc/mtd
    13101362
     1363DHCP range for openwrt AP's fixen classes mac prefix?
     1364        DHCPD.conf hoeft alleen nog een aanpassing voor andere lease time per klasse!
     1365        op ieder ap, moet het openvpn fake mac address op dezelfde manier als het wifi-update script vervangen worden
     1366        anders weet de dhcp server niet het juiste mac prefix te herkennen om de ap's in een andere interface te doen.
     1367        ook een vraag is of die interface uberhaubt wel een ip hoeft te hebben?
     1368
    13111369TODO Verzin leuke manier om dit in een batch workflow voor veel AP's clients in te passen... denken we vanuit dit concept met tar bestand of moeten we iets maken dat meteen meedere parameters zoals multiSSID ip-adres hostname wifichannel etc meeneemt op basis van MAC adres? Nog uitzoeken welk deel er naar de server moet 4 bestanden ca dh1024 server.crt/key?
    13121370
     
    13151373testen broadcast AP's onderling onmogelijk?
    13161374Filteren / dhcp bdup/stp requests
    1317 DHCP range for ubnt AP's fixen
     1375
    13181376
    13191377Veiligheid aspect, VLAN/ radius authenticatie over zelfde tunnels als de clients... isolation tussen openvpn clients de AP's zelf is actief maar isolate van de wireless users op de client nog teste?