51 | | Met deze middelen en een complete voor zover mogelijk lineaire stap voor stap handleiding (die nu gaat volgen) is een plug en play exploitatie van eduroam toegangspunten waar dan ook binnen het Wireless Leiden netwerk snel en eenvoudig te realiseren. Door het gebruik van het opensource software RouterOS [http://www.openwrt.org OpenWRT], [http:/www.freebsd.org FREEBSD] en gerelateerde software projecten, is deze setup niet gelimiteerd aan een enkel merk en of type hardware. Een kleine aanpassing aan de configuratie bestanden zou een vereiste kunnen zijn voordat het op ander hardware platvorm werkt. Deze handleiding zal overigens alleen gespitst zijn op Ubiquity AP's zoals Bullet m2HP/Nano station/loco m2 en via-epia-m/alixboard als radiusproxy/server & gateway. Als uitgangssituatie om deze handleiding te uit te voeren word ubuntu 12.04LTS AMD64 gebruikt! |
52 | | |
53 | | === 1 setup eduroam AccessPoints === |
| 51 | Met deze middelen en een compleet voor zover mogelijk lineaire stap voor stap handleiding is een plug en play exploitatie van eduroam toegangspunten waar dan ook binnen het Wireless Leiden netwerk snel en eenvoudig te realiseren. Voor het opleveren van veel AP's (bacthes) met verschillende instellingen zal er uiteindelijk een configuratie script volgen waarmee op basis van het MAC-adres van het AP een aantal unieke parameters meegegeven kunnen worden voor de configuratie zoals: MultiSSID, hostname, kanaal, ipadres(bedraad/draadloos), etc... |
| 52 | |
| 53 | Door het gebruik van het opensource software RouterOS [http://www.openwrt.org OpenWRT], [http:/www.freebsd.org FREEBSD] en gerelateerde software projecten, is deze setup niet gelimiteerd aan een enkel merk en of type hardware. Een kleine aanpassing aan de configuratie bestanden zou een vereiste kunnen zijn voordat het op ander hardware platvorm werkt. Deze handleiding zal overigens alleen toegespitst zijn op Ubiquiti AP's zoals Bullet m2 HP/ Nano station/loco m2 en via-epia-m/alixboard als radiusproxy/server & gateway. Als uitgangssituatie om deze handleiding uit te voeren word ubuntu 12.04LTS AMD64 gebruikt! |
| 54 | |
| 55 | === 1 setup eduroam !AccessPoints === |
55 | | Met deze flexibele fundering is het doel om accesspoints die maar in sumiere opzichten van elkaar te verschillen zo gemakkelijk en snel mogelijk in grote hoeveelheden geautomatiseerd te kunnen configureren. Het verschil tussen de accesspoints komt deels uit hoek van beveiliging, deels uit de hoek van locatie en natuurlijk de toepassing. Als een enkel accesspoint gehackt is kan deze los van de andere accesspoint toegang tot de radius proxy ontzegt worden (door zijn openvpn sleutel in te trekken) daardoor zijn de andere accesspoints nog operationeel. Als toepassing is het handig dat het eduroam accesspoint op de burcht in Leiden als multi SSID "ap.burcht.wleiden.net" heet en de eduroam accesspoint bij de HortusBotanicus als multi SSID "ap.hortusbotanicus.wleiden.net". Als toepassing kan het wenselijk zijn kleine / goedkopere AP's te monteren op plaatsen waar grote AP's met losse sector antennes niet mogelijk zijn en natuurlijk niet te vergeten de beschikbare wifi kanalen 1,6,11. Deze voorbeelden duiden erop dat er toch kleine specifieke wijzigingen tussen de AccessPoints configuratie bestanden wenselijk zijn. |
56 | | |
57 | | In tegenstelling tot de oude handleiding(onderaan deze pagina) word momenteel gebruik gemaakt van een fixed OpenWRT releases waaronder Backfire 10.03.1 of zelfs Atitude Adjustment 12.0.9 final. Dit niet alleen omdat het bouwen van een custombuild onnodig is geworden omdat "openvpn" inmiddels als pakket direct gebruiksklaar en beschikbaar is voor de 10.03.1 / 12.09 releases. Maar vooral omdat compileren van een openwrt build omgeving en image erg veel tijd, moeite en veel variabelen introduceert in een al experimentele infrastructuur. Met fixed releases kan in minder dan 5 minuten direct een werkend accesspoint prototype gerealiseerd worden en dat zelf voor verschillende type accesspoints(mits daar openwrt images voor zijn)! Wel zou via custom gecompileerde releases het geheugen gebruik en processor belasting geoptimaliseerd kunnen worden door het weglaten van ongebruikte pakketten. Update, inmiddels is het ook al mogelijk om direct via de default AirOS software dat op de Ubiquiti AP's al aanwezig is een dergelijke opstelling te maken(enkel openvpn ontbreekt)! |
| 57 | Met deze flexibele fundering is het doel om accesspoints die maar in sumiere opzichten van elkaar te verschillen zo gemakkelijk en snel mogelijk in grote hoeveelheden geautomatiseerd te kunnen configureren. Het verschil tussen de accesspoints komt deels uit hoek van beveiliging, deels uit de hoek van locatie en natuurlijk de toepassing. Als een enkel accesspoint gehackt is kan deze los van de andere accesspoint toegang tot de radius proxy ontzegt worden (door zijn openvpn sleutel in te trekken) daardoor zijn de andere accesspoints nog operationeel. Als toepassing is het handig dat het eduroam accesspoint op de burcht in Leiden als multi-SSID "ap.burcht.wleiden.net" heet en de eduroam accesspoint bij de Hortus Botanicus als multi-SSID "ap.hortusbotanicus.wleiden.net". Als toepassing kan het wenselijk zijn kleine / goedkopere AP's te monteren op plaatsen waar grote AP's met losse sector antennes niet mogelijk zijn en natuurlijk niet te vergeten de beschikbare wifi kanalen 1,6,11. Deze voorbeelden duiden erop dat er toch kleine specifieke wijzigingen tussen de !AccessPoints configuratie bestanden wenselijk zijn. |
| 58 | |
| 59 | In tegenstelling tot de oude handleiding(onderaan deze pagina) word momenteel gebruik gemaakt van een fixed OpenWRT releases waaronder Backfire 10.03.1 of zelfs Atitude Adjustment 12.0.9 final. Dit niet alleen omdat het bouwen van een custombuild onnodig is geworden omdat "openvpn" inmiddels als pakket direct gebruiksklaar en beschikbaar is voor de 10.03.1 / 12.09 releases. Maar vooral omdat compileren van een openwrt build omgeving en image erg veel tijd, moeite en veel variabelen introduceert in een al/nog experimentele infrastructuur. Met fixed releases kan in minder dan 5 minuten direct een werkend accesspoint prototype gerealiseerd worden en dat zelfs voor verschillende type accesspoints (mits daar openwrt images voor zijn)! Wel zou via custom gecompileerde releases het geheugen gebruik en processor belasting geoptimaliseerd kunnen worden door het weglaten van ongebruikte pakketten. Update, inmiddels is het ook al direct mogelijk om via AirOS software dat standaard al op Ubiquiti AP's aanwezig is een wpa2 enterprise met radius client functie maken (enkel openvpn ontbreekt)! |
| 60 | |
| 61 | Het AccessPoint zal met multiSSID ingesteld worden en bridged al het internet verkeer van de beveiligde "eduroam" SSID naar een externe router en het verkeer van de open "ap.voorbeeld.wleiden.net" SSID via een interne NAT/routing. TODO Deze laatste zou ook direct moeten bridgen naar de eth0/wan interface, maar daarvoor zijn momenteel de firewall regels te generiek en word deze extra bridge geblokkeerd door de br* wildcard. Wanneer dit lukt dan bridged deze het verkeer een Wireless Leiden node in met eigen Captive Portal setup! |
79 | | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/openvpn_2.1.4-3_ar71xx.ipk |
80 | | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/kmod-tun_2.6.32.27-1_ar71xx.ipk |
81 | | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/libopenssl_0.9.8r-1_ar71xx.ipk |
82 | | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/zlib_1.2.3-5_ar71xx.ipk |
83 | | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/liblzo_2.04-1_ar71xx.ipk |
| 82 | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/openvpn_2.1.4-3_ar71xx.ipk -P packages/ |
| 83 | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/kmod-tun_2.6.32.27-1_ar71xx.ipk -P packages/ |
| 84 | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/libopenssl_0.9.8r-1_ar71xx.ipk -P packages/ |
| 85 | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/zlib_1.2.3-5_ar71xx.ipk -P packages/ |
| 86 | wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/liblzo_2.04-1_ar71xx.ipk -P packages/ |
117 | | scp -r root@192.168.1.20:/etc .#inclode the dot '.' at the end! |
118 | | }}} |
119 | | Settings that differ among AccesPoints like multiSSID,ipadress,wifichannel,hostname,etc are coloured! |
120 | | {{{ |
121 | | ## only a couple of files needs editing/configuring this will be done locally |
| 120 | mkdir backup |
| 121 | scp -r root@192.168.1.20:/etc backup/ |
| 122 | }}} |
| 123 | For deploying huge quantity (batch(es)) of AP's the following settings are general but some may differ among AccesPoints like: multiSSID,ipadress(wired/wireless),wifichannel,band(a/bg),hostname,etc. In the following config files those parts that makes the uniqueness will be coloured so its easier to identify and customize. Use the files from the backup you just made as a template, since the example config files which will follow after this paragraph are hardware-type/image specific! That means that my config files are specific for the Ubiquiti bullet2m hp, and for instance will not work on linksys broadcom based AP hardware(because wifi interfaces are configured using different names and parameters)! So only copy/paste change the needed parts, that differ with your templates! |
| 124 | #create folder structure to put customized config files! |
| 125 | {{{ |
| 126 | mkdir -p customize/etc/config |
| 127 | mkdir -p customize/etc/init.d |
| 128 | mkdir -p custom/sbin |
| 129 | mkdir -p custom/usr/sbin |
| 130 | }}} |
| 132 | {{{ |
| 133 | config dnsmasq |
| 134 | option domainneeded 1 |
| 135 | option boguspriv 1 |
| 136 | option filterwin2k 0 # enable for dial on demand |
| 137 | option localise_queries 1 |
| 138 | option rebind_protection 1 # disable if upstream must serve RFC1918 addresses |
| 139 | option rebind_localhost 1 # enable for RBL checking and similar services |
| 140 | #list rebind_domain example.lan # whitelist RFC1918 responses for domains |
| 141 | option local '/lan/' |
| 142 | option domain 'lan' |
| 143 | option expandhosts 1 |
| 144 | option nonegcache 0 |
| 145 | option authoritative 1 |
| 146 | option readethers 1 |
| 147 | option leasefile '/tmp/dhcp.leases' |
| 148 | option resolvfile '/tmp/resolv.conf.auto' |
| 149 | #list server '/mycompany.local/1.2.3.4' |
| 150 | #option nonwildcard 1 |
| 151 | #list interface br-lan |
| 152 | #list notinterface lo |
| 153 | #list bogusnxdomain '64.94.110.11' |
| 154 | |
| 155 | config dhcp lan |
| 156 | option interface lan |
| 157 | option start 100 |
| 158 | option limit 150 |
| 159 | option leasetime 12h |
| 160 | |
| 161 | config dhcp wan |
| 162 | option interface wan |
| 163 | option ignore 1 |
| 164 | |
| 165 | config dhcp wlgst |
| 166 | option interface wlgst |
| 167 | option start 5 |
| 168 | option limit 252 |
| 169 | option leasetime 1h |
| 170 | }}} |
| 171 | |
| 172 | {{{ |
| 174 | {{{ |
| 175 | config defaults |
| 176 | option syn_flood 1 |
| 177 | option input ACCEPT |
| 178 | option output ACCEPT |
| 179 | option forward REJECT |
| 180 | # Uncomment this line to disable ipv6 rules |
| 181 | # option disable_ipv6 1 |
| 182 | |
| 183 | config zone |
| 184 | option name lan |
| 185 | option network 'lan' |
| 186 | option input ACCEPT |
| 187 | option output ACCEPT |
| 188 | option forward REJECT |
| 189 | |
| 190 | config zone |
| 191 | option name wan |
| 192 | option network 'eth0' |
| 193 | option input REJECT |
| 194 | option output ACCEPT |
| 195 | option forward REJECT |
| 196 | option masq 1 |
| 197 | option mtu_fix 1 |
| 198 | |
| 199 | # Allow multiple ssid accespoint |
| 200 | config zone |
| 201 | option name wlgst |
| 202 | option input REJECT |
| 203 | option forward REJECT |
| 204 | option output ACCEPT |
| 205 | |
| 206 | # Changing wan > eth0 made all these rules active! |
| 207 | # Therefor no ssh access anymore from wan and lans is not available |
| 208 | # Allow SSH |
| 209 | config rule |
| 210 | option src wan |
| 211 | option proto tcp |
| 212 | option dest_port ssh |
| 213 | option target ACCEPT |
| 214 | |
| 215 | config forwarding |
| 216 | option src lan |
| 217 | option dest wan |
| 218 | |
| 219 | # Allow wlgst to internet wan/eth0? |
| 220 | config forwarding |
| 221 | option src wlgst |
| 222 | option dest wan |
| 223 | |
| 224 | # Allow wlgst -> Router |
| 225 | # Client DNS queries ordinate from dynamic UDP ports (>1023) |
| 226 | config rule |
| 227 | option src wlgst |
| 228 | option dest_port 53 |
| 229 | option proto tcpudp |
| 230 | option target ACCEPT |
| 231 | |
| 232 | # Allow DHCP Guest -> Router |
| 233 | # DHCP communication uses UDP ports 67-68 |
| 234 | config rule |
| 235 | option src wlgst |
| 236 | option src_port 67-68 |
| 237 | option dest_port 67-68 |
| 238 | option proto udp |
| 239 | option target ACCEPT |
| 240 | |
| 241 | # We need to accept udp packets on port 68, |
| 242 | # see https://dev.openwrt.org/ticket/4108 |
| 243 | config rule |
| 244 | option name Allow-DHCP-Renew |
| 245 | option src wan |
| 246 | option proto udp |
| 247 | option dest_port 68 |
| 248 | option target ACCEPT |
| 249 | option family ipv4 |
| 250 | |
| 251 | # Allow IPv4 ping |
| 252 | config rule |
| 253 | option name Allow-Ping |
| 254 | option src wan |
| 255 | option proto icmp |
| 256 | option icmp_type echo-request |
| 257 | option family ipv4 |
| 258 | option target ACCEPT |
| 259 | |
| 260 | # Allow DHCPv6 replies |
| 261 | # see https://dev.openwrt.org/ticket/10381 |
| 262 | config rule |
| 263 | option name Allow-DHCPv6 |
| 264 | option src wan |
| 265 | option proto udp |
| 266 | option src_ip fe80::/10 |
| 267 | option src_port 547 |
| 268 | option dest_ip fe80::/10 |
| 269 | option dest_port 546 |
| 270 | option family ipv6 |
| 271 | option target ACCEPT |
| 272 | |
| 273 | # Allow essential incoming IPv6 ICMP traffic |
| 274 | config rule |
| 275 | option name Allow-ICMPv6-Input |
| 276 | option src wan |
| 277 | option proto icmp |
| 278 | list icmp_type echo-request |
| 279 | list icmp_type destination-unreachable |
| 280 | list icmp_type packet-too-big |
| 281 | list icmp_type time-exceeded |
| 282 | list icmp_type bad-header |
| 283 | list icmp_type unknown-header-type |
| 284 | list icmp_type router-solicitation |
| 285 | list icmp_type neighbour-solicitation |
| 286 | option limit 1000/sec |
| 287 | option family ipv6 |
| 288 | option target ACCEPT |
| 289 | |
| 290 | # Allow essential forwarded IPv6 ICMP traffic |
| 291 | config rule |
| 292 | option name Allow-ICMPv6-Forward |
| 293 | option src wan |
| 294 | option dest * |
| 295 | option proto icmp |
| 296 | list icmp_type echo-request |
| 297 | list icmp_type destination-unreachable |
| 298 | list icmp_type packet-too-big |
| 299 | list icmp_type time-exceeded |
| 300 | list icmp_type bad-header |
| 301 | list icmp_type unknown-header-type |
| 302 | option limit 1000/sec |
| 303 | option family ipv6 |
| 304 | option target ACCEPT |
| 305 | |
| 306 | # include a file with users custom iptables rules |
| 307 | config include |
| 308 | option path /etc/firewall.user |
| 309 | }}} |
| 310 | |
| 439 | {{{ |
| 440 | # This file is interpreted as shell script. |
| 441 | # Put your custom iptables rules here, they will |
| 442 | # be executed with each firewall (re-)start. |
| 443 | |
| 444 | |
| 445 | iptables -I INPUT -i tap+ -j ACCEPT |
| 446 | iptables -I FORWARD -i tap+ -j ACCEPT |
| 447 | iptables -I OUTPUT -o tap+ -j ACCEPT |
| 448 | iptables -I FORWARD -o tap+ -j ACCEPT |
| 449 | |
| 450 | iptables -I INPUT -i br+ -j ACCEPT |
| 451 | iptables -I FORWARD -i br+ -j ACCEPT |
| 452 | iptables -I OUTPUT -o br+ -j ACCEPT |
| 453 | iptables -I FORWARD -o br+ -j ACCEPT |
| 454 | |
| 455 | iptables -t nat -A POSTROUTING -o br-lan -j MASQUERADE |
| 456 | }}} |
| 457 | |
134 | | |
| 468 | {{{ |
| 469 | # Put your custom commands here that should be executed once |
| 470 | # the system init finished. By default this file does nothing. |
| 471 | if [ -L "/dev/random" ]; |
| 472 | then |
| 473 | echo 'Random-Link already OK' |
| 474 | else |
| 475 | echo 'Random-Link not existing, creating,...' |
| 476 | rm -f /dev/random 2> /dev/null |
| 477 | ln -s /dev/urandom /dev/random |
| 478 | fi |
| 479 | /bin/sleep 5 |
| 480 | /usr/sbin/ntpd -q -p pool.ntp.wleiden.net |
| 481 | exit 0 |
| 482 | }}} |
| 483 | |
| 484 | The following files probably won't exist, but are common on all ap's that are used for this setup. |