Changes between Initial Version and Version 1 of doc/gateway-server/WifiDogAndOlsr

Show
Ignore:
Timestamp:
01/31/06 15:20:52 (15 years ago)
Author:
Prospere
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/gateway-server/WifiDogAndOlsr

    v1 v1  
     1'''The problem :''' 
     2 
     3If you chose to install only one Wifidog gateway server, all the clients MAC addresses will be masqued 
     4by the nearest OLSR router. 
     5 
     6'''The solution :''' 
     7 
     8Install Wifidog on all the OLSR nodes. 
     9Allow HTTP flow between OLSR nodes with a script launched by cron. 
     10 
     11{{{ 
     12  ipkg install ip 
     13}}} 
     14 
     15{{{ 
     16 
     17#!/bin/sh 
     18# 
     19# Script to bypass HTTP interception for traffic forwarded by OLSR 
     20# bms 9-Aug-2005 
     21# Licensed under GPL 
     22# 
     23 
     24rm -f /tmp/get_neighbors.awk 
     25cat > /tmp/get_neighbors.awk <<__HERE1__ 
     26BEGIN { 
     27  while("ip route"|getline) { 
     28      if (\$6 == "metric") { 
     29        if (\$7 > 0) { 
     30          printf "%s\n", \$1; 
     31        } 
     32    } 
     33  } 
     34} 
     35__HERE1__ 
     36 
     37 
     38iptables -t nat -D WiFiDog_Unknown -j OlsrNeighbors 2>&1 >/dev/null 
     39iptables -t nat -F OlsrNeighbors 2>&1 >/dev/null 
     40iptables -t nat -X OlsrNeighbors 2>&1 >/dev/null 
     41iptables -t nat -N OlsrNeighbors 
     42 
     43neighbors=$(awk -f /tmp/get_neighbors.awk) 
     44 
     45for _neighbor in ${neighbors} ; do 
     46 
     47   _mac=$(grep "^${_neighbor}" /proc/net/arp | awk '{print $4}') 
     48   echo ${_mac} 
     49   iptables -t nat -A OlsrNeighbors -m mac --mac-source ${_mac} \ 
     50          -p tcp --dport 80 -j ACCEPT 
     51           
     52done 
     53 
     54iptables -t nat -I WiFiDog_Unknown -j OlsrNeighbors 
     55 
     56}}} 
     57 
     58I modify the original script from Bruce Simpson. I replace the orginal "route -n" with an "ip route". 
     59Thanks to the author !! And London Wireless !