Voici une evolution du script OLSR wifidog par un contact italien
---------- Forwarded message ----------
From: Roberto Bellina <[EMAIL PROTECTED]>
Date: Sat, May 17, 2008 at 11:50 AM
Subject: Olsr multinodes, wifidog --> Solved
To: michel memeteau <[EMAIL PROTECTED]>
Hi Michel
Sorry for stress you up, i've solved the problem, was an error in the
script
the correct should be as follow
#!/bin/sh
#
# Script to bypass HTTP interception for traffic forwarded by OLSR
# bms 9-Aug-2005
# Licensed under GPL
#
rm -f /tmp/get_neighbors.awk
cat > /tmp/get_neighbors.awk <<__HERE1__
BEGIN {
while("route -n"|getline) {
if (/^[0-9]/) {
if (0 < \$5) {
if (\$3 == "255.255.255.255") {
printf "%s\n", \$1;
}
}
}
}
}
__HERE1__
iptables -t nat -D WiFiDog_Unknown -j OlsrNeighbors 2>&1 >/dev/null
iptables -t nat -F OlsrNeighbors 2>&1 >/dev/null
iptables -t nat -X OlsrNeighbors 2>&1 >/dev/null
iptables -t nat -N OlsrNeighbors
neighbors=$(awk -f /tmp/get_neighbors.awk)
for _neighbor in ${neighbors} ; do
_mac=$(grep "^${_neighbor} " /proc/net/arp | awk '{print $4}')
echo ${_mac}
iptables -t nat -A OlsrNeighbors -m mac --mac-source ${_mac} \
-p tcp --dport 80 -j ACCEPT
done
# iptables -t nat -I WiFiDog_Unknown -j OlsrNeighbors
iptables -t nat -I WifiDog_Unknown -j OlsrNeighbors
I've just add 3 modifications to get correct IP of all of the OLSR nodes,
and dig inside /proc/net/arp to get only corrects MAC's
Thanks again for your precious script
Hope to see meet you in the future
Roby.
--
%<------------------------------------------------------->%
Michel memeteau
Blog 0.2 : http://memeteau.free.fr
Fixe : 0874763294 Mobile : 0624808051
VOIP | Visio: sip:[EMAIL PROTECTED]<[EMAIL PROTECTED]>
jabber/GoogleTalk : xmpp:[EMAIL PROTECTED] <[EMAIL PROTECTED]>