Changes between Version 45 and Version 46 of WikiStart


Ignore:
Timestamp:
May 5, 2013, 3:05:20 PM (12 years ago)
Author:
walter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v45 v46  
    1919
    2020== Betrokkenheid van Wireless Leiden? ==
     21
     22TODO geschiedenis toevoegen?
    2123
    2224De betekenis en werkwijze van eduroam voor dit Wireless Leiden project is vanuit een "aanbieders" perspectief. Daarbij zal voornamelijk de onderliggende technische werking van de infrastructuur om eduroam accesspoints (voor gebruikers) te realiseren ter sprake komen. 
     
    2426Als partieel serviceprovider koppelt Wireless Leiden eduroam gebruikers automatisch en beveiligd door aan de daarvoor aangewezen (onderwijs)netwerken. Een onderwijsinstelling vervult vaak meerdere rollen binnen het eduroam project inclusief internet-gateway, maar Wireless Leiden beperkt zich puur tot de ondersteunende koppeling en integratie van deze diensten.
    2527
    26 Het unieke aan dit project is niet het scheiden van de identity/service provider eigenschap, maar de integratie van de verdeelde diensten over het onafhankelijk en "open" netwerk van Wireless Leiden dat zich buiten deur huisvest.
     28Het unieke aan dit project is niet het scheiden van de identity/service provider eigenschap, maar de integratie van de verdeelde diensten over het onafhankelijk en "open" netwerk van Wireless Leiden dat zich buiten de deur huisvest.
    2729Dit maakt het exploiteren van eduroam draadloze dekking via het Wireless Leiden netwerk in publieke ruimte niet alleen eenvoudig, flexibel en betaalbaar maar kan dat zelfs op stadsniveau! De huidige implementatie is een win-win situatie voor betrokken partijen, door de huidige multi SSID techniek neemt zowel de dekking van het eduroam netwerk van een (sponserende) onderwijsinstelling als het netwerk van Wireless Leiden toe. Dit in tegenstelling tot de vaak beperkt inpandige exploitatie door onderwijsinstellingen van hun eigen geisoleerde fysieke en gesloten infrastructuur, die zich gemakkelijk door het graven/leggen van dure kabelverbindingen laat uitstellen of zelfs afstellen.
    2830
     
    9193# when blinking red/green the reset button can be released
    9294# the device is now in tftp mode
    93 # todo get in tftp without reset button... but via triggering mtd?
    94 
    95 ## use / install tftpclient utility to flash the openwrt image
     95# todo get in tftp without reset button... via triggering mtd in AirOS?
     96
     97## use tftpclient utility to flash the openwrt image
    9698tftp 192.168.1.20
    9799        binary
     
    120122{{{
    121123## create folder structure for customized config files!
     124mkdir -p customize/etc/openvpn
    122125mkdir -p customize/etc/config
    123126mkdir -p customize/etc/init.d
    124127mkdir -p customize/sbin
    125128mkdir -p customize/usr/sbin
     129
     130##copy/make files to use as template!
     131cp backup/etc/config/dhcp customize/etc/config/
     132cp backup/etc/config/firewall customize/etc/config/
     133cp backup/etc/config/network customize/etc/config/
     134cp backup/etc/config/system customize/etc/config/
     135cp backup/etc/config/wireless customize/etc/config/
     136
     137cp backup/etc/init.d/openvpn customize/etc/config/
     138cp backup/etc/init.d/sysntpd customize/etc/config/
     139
     140cp backup/etc/firewall.user customize/etc/config/
     141cp backup/etc/inittab customize/etc/config/
     142cp backup/etc/rc.local customize/etc/config/
     143
     144touch customize/etc/sbin/wifi-update
     145touch customize/usr/sbin/iopenvpn
     146
     147## adjust your template files using the following examples!
    126148}}}
    127149
     
    133155        option filterwin2k      0  # enable for dial on demand
    134156        option localise_queries 1
    135         option rebind_protection 1  #! disable if upstream must serve RFC1918 addresses <--- change to 0 if local dns for wan won't work
     157        option rebind_protection 1  #! disable if upstream must serve RFC1918 addresses <--- change to 0 if local dns "wleiden.net" won't resolve
    136158        option rebind_localhost 1  # enable for RBL checking and similar services
    137159        #list rebind_domain example.lan  # whitelist RFC1918 responses for domains
     
    316338
    317339#!this interface is wired to the Wireless Leiden infrastructure!
    318 config interface wan #!interface name wan vs eth0 applies firewall rules <---
     340config interface wan #!interface name wan vs eth0 applies /etc/config/firewall rules <---
    319341        option ifname   eth0
    320342        option type     bridge #! use bridge to forward DHCP,DNS,captive portal,etc from WirelessLeiden node to 2nd multiSSID <---
    321 #       option proto    static #! Unique ip settings! <---
    322343        option proto    dhcp
    323 #       option ipaddr   172.16.6.13
    324 #       option netmask  255.255.255.248
    325 #       option gateway  172.16.6.9
    326 #       option dns      172.16.6.9     
     344        option peerdns  172.16.6.9 #! if dhcp is used, local dns wleiden.net resolve fix?<---
     345#       option proto    static #! Unique static ip vs dhcp! <---
     346#       option ipaddr   172.16.6.13 #! Unique ip settings differ! <---
     347#       option netmask  255.255.255.248 #! Unique ip settings differ! <---
     348#       option gateway  172.16.6.9 #! Unique ip settings differ! <---
     349#       option dns      172.16.6.9 #! Unique ip settings differ! <---   
    327350       
    328351config interface lan
     
    330353        option type     bridge
    331354
    332 #!Add this interface if you NAT/Route the 2nd multiSSID internal <---
     355#!Add this interface if you internally NAT/Route the 2nd multiSSID instead of bridge <---
    333356#!config interface wlgst
    334357#!      option ifname   wlgst
     
    342365{{{
    343366config  system
    344         option  hostname  eduroam-bullet #!Unique name! <---
    345         option  timezone  CET-1CEST,M3.5.0,M10.5.0/3 #!correct timezone <---
     367        option  hostname  eduroam-bullet #!Unique name differ! <---
     368        option  timezone  CET-1CEST,M3.5.0,M10.5.0/3 #!correct timezone Amsterdam Netherlands <---
    346369
    347370config  timeserver ntp
    348         list server     pool.ntp.wleiden.net #! <---
     371        list server     pool.ntp.wleiden.net #! WirelessLeiden local ntp server <---
    349372        list server     1.openwrt.pool.ntp.org
    350373        list server     2.openwrt.pool.ntp.org
     
    354377#/etc/config/wireless
    355378{{{
    356 config wifi-device  radio0
    357         option type     mac80211
    358         option channel  5 #! Unique channels must be set for multiple AP's at one site! <---
    359         option macaddr  MACADDRESS
     379config wifi-device  radio0 #! names and config parameters are different for wifi architectures, ar71xx,brcm47xx,x86,etc <---
     380        option type     mac80211 
     381        option channel  5 #! Unique channels must be set since multiple AP's at one site differs 1,6,11! <---
     382        option macaddr  MACADDRESS # this will be set by another script, leave it alone!!! <---
    360383        option hwmode   11bg #when using 5ghz vs 2,4ghz '11na' must be set! <---
    361384        option htmode   HT20
     
    372395        option bridge   br-lan
    373396        option mode     ap
    374         option ssid     eduroam
     397        option ssid     eduroam #! its all about this one!!!<---
    375398        option encryption wpa2
    376399        option server   192.168.4.1 #! Location of radius-server/proxy behind the tunnel 1812/1813 <---
     
    488511}}}
    489512
    490 The following files need to be created but are common on all ap's that are used for this setup.
    491 
    492 #/sbin/wifi-update TODO TEST!!!
     513
     514#/sbin/wifi-update #test create yourself
    493515{{{
    494516#!/bin/sh
     
    499521}}}
    500522
    501 #/usr/sbin/iopenvpn
     523#/usr/sbin/iopenvpn #create yourself
    502524{{{
    503525#!/bin/sh
     
    517539}}}
    518540
    519 ##TODO openvpn key/certificates
    520 Skip to section 3 of this howto, when you have a *.tar file with keys&config comeback ;-)
    521 
    522 # upload openvpn config and keys (keys.tar)
     541Setup openvpn key/certificates/config for the AP, Skip to section 3 of this howto, when you have a *.tar file with keys&config comeback ;-)
     542
     543{{{
     544## put openvpn config and keys in customize folder!
    523545tar -xf $nameofyour.tar
    524 cp keys/* etc/openvpn/
    525 
    526 ## install config files to correct location
    527 #
     546cp keys/* customize/etc/openvpn/
     547
     548## copy/install customized template to AP
    528549scp -r customize/ root@192.168.1.100:/
    529 
    530 ## use ssh to configure final settings
     550}}}
     551
     552Finnaly use ssh again to configure final settings
     553{{{
    531554ssh root@192.168.1.20
    532555
    533 ## openvpn specific config
     556## enable openvpn
     557chmod +x /usr/sbin/iopenvpn
    534558chmod +x /etc/openvpn/up.sh
    535559/etc/init.d/openvpn enable
    536560
    537 ## activate wifi to add macadress to config file
     561
     562
     563## activate wifi to add MACadress to /etc/config/wireless file
    538564/sbin/wifi stop
    539565#/sbin/wifi start
     
    547573reboot;exit
    548574
     575## done
     576#check your working "eduroam" accesspoint!
    549577}}}
    550578
     
    568596Voornamelijk de config van raddb helemaal ombouwen omdat alle parameters voor FREEBSD zijn! dan nog een iptable edit doen en dan deed die het???
    569597
    570 === 3 certnode sunfire uitzoeken ===
     598=== 3 certnode ===
     599Voor het functioneren van openvpn waaronder beveiligen en herkennen van server en unieke clients word easy-rsa gebruikt. Het idee is om op een vertrouwde permanente machine "certnode" een permanente opzet te maken waar een openvpn server certificate voor de radius-server/proxy word aangemaakt, dat weer de basis zal vormen voor client certificaten voor de verschillende accesspoints. Het eerste gebeurt eenmalig en zal lokaal op de certnode bewaart moeten blijven, het tweede gebeurt per op te leveren unieke AP waar er meerdere van zullen zijn. Het server certificaat + openvpn settings zal eenmalig van de certnode op de radius-server/proxy geplaatst worden. De unieke client certificaten worden "per AP" eenmalig op de certnode aangemaakt en vervolgens eenmalig per uniek AP geflashed! Hierdoor zijn de AP's individueel te volgen en te beheren om toegang tot the radius-server/proxy te ontzeggen.
     600
    571601Kan inloggen via public ssh key op sunny/sunfire.wleiden.net kan daarinderdaad het script starten maar vervolgens kan deze niks vinden. Lijkt erop dat de oude server certificaten niet aanwezig zijn en er kunnen dan geen afgeleide client certifcaten gemaakt worden tevens missen er config bestanden, dus alles moet opnieuw? Hoe maak ik dit lokaal na?
    572602Namaken: https://help.ubuntu.com/community/OpenVPN
    573603Een easyrsa "server" certificate aanmaken, in de handleiding i.p.v. "admin" group die ontbreekt "sudo" kiezen. Tevens locatie van het cn bestand fixen met symlink!
    574 
    575 
    576604Daarna kan je easyrsa "client" certificate aanmaken, enige opmerking daar is dat je KEY_CN=client voor het commando plaatst anders database error. Nu in de oude trend kun je het eduroam-cert script aanpassen en benodigde (geupdate)config bestanden in map key's plaatsen en daarin een map met packages aanmaken. Wanneer je dan het script draait maakt die inderdaad een tar bestand met alle instellingen.
    577 
    578605TODO 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?
     606
     607#/etc/openvpn/easy-rsa/keys/client.conf
     608{{{
     609client
     610dev tap0
     611proto tcp #! for flappering/instable routing on W.L. use TCP instead of udp <---
     612remote 172.17.169.67 53 #! location of openvpn server(radius-server/proxy & gateway) on the WireLessLeiden network! <---
     613resolv-retry infinite
     614persist-key
     615persist-tun
     616ca /etc/openvpn/ca.crt
     617cert /etc/openvpn/client.crt
     618key /etc/openvpn/client.key
     619verb 3
     620log /var/log/openvpn.log
     621up /etc/openvpn/up.sh
     622script-security 2
     623keepalive 10 180 #! these settings keep the tunnel alive on the W.L. network<---
     624}}}
     625
     626# /usr/local/bin/eduroam-client-openvpn-cert
     627{{{
     628#!/bin/sh
     629
     630# put me in /usr/local/bin
     631
     632FROMBASE=./keys
     633TOBASE=./keys/packages
     634COMMON=$1
     635TAR=$TOBASE/$COMMON.tar
     636USER=$SUDO_USER
     637CLIENT=client
     638
     639if [ ! $1 ]; then
     640  echo "no common name given"
     641  exit 1
     642fi
     643
     644if [ ! -f $TAR ]; then
     645
     646  cd /etc/openvpn/easy-rsa
     647
     648  . ./vars
     649  KEY_CN=$COMMON ./pkitool $COMMON
     650
     651  mv $FROMBASE/$COMMON.key $FROMBASE/$CLIENT.key
     652  mv $FROMBASE/$COMMON.crt $FROMBASE/$CLIENT.crt
     653
     654  tar -cf $TAR \
     655  $FROMBASE/ca.crt \
     656  $FROMBASE/$CLIENT.key \
     657  $FROMBASE/$CLIENT.crt \
     658  $FROMBASE/client.conf \
     659  $FROMBASE/up.sh
     660
     661  cp $TAR /home/$USER/$COMMON.tar
     662  chown $USER /home/$USER/$COMMON.tar
     663 
     664else
     665
     666  echo "$TAR was already created"
     667  exit 1
     668
     669fi
     670}}}
     671
    579672
    580673= Old HOWTO =