diff --git a/README.md b/README.md index c5dbfb0..52c4556 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,15 @@ If you only have two NICs, you can buy this cheap USB 100Mbps NIC [from Amazon]( scp bin/pfatt.sh root@pfsense:/root/bin/ ssh root@pfsense chmod +x /root/bin/pfatt.sh ``` - Now edit your `config.xml` to include `/root/bin/pfatt.sh` above `` + Now edit your `/conf/config.xml` to include `/root/bin/pfatt.sh` above ``. + + **NOTE:** If you have the 5268AC, you'll also need to install `pfatt-5268.sh` due to [issue #5](https://github.com/aus/pfatt/issues/5). The script monitors your connection and disables or enables the EAP bridging as needed. It's a hacky workaround, but it enables you to keep your 5268AC connected, avoid EAP-Logoffs and survive reboots. Perfom these additional steps to install: + + Copy `bin/pfatt-5268AC.sh` to `/usr/local/etc/rc.d/`: + ``` + scp bin/pfatt-5268AC.sh root@pfsense:/usr/local/etc/rc.d/ + ssh root@pfsense chmod +x /usr/local/etc/rc.d/pfatt-5268AC.sh + ``` 4. Connect cables: - `$RG_IF` to Residiential Gateway on the ONT port (not the LAN ports!) diff --git a/bin/pfatt-5268AC.sh b/bin/pfatt-5268AC.sh new file mode 100644 index 0000000..e886923 --- /dev/null +++ b/bin/pfatt-5268AC.sh @@ -0,0 +1,31 @@ +#!/bin/sh +PING_HOST=8.8.8.8 +SLEEP=5 +LOG=/var/log/pfatt.log + +getTimestamp(){ + echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt-5268AC.sh] ::"` +} + +{ + RG_CONNECTED="/usr/sbin/ngctl show laneapfilter:eapout" + + echo "$(getTimestamp) Starting 5268AC ping monitor ..." + while + if /sbin/ping -t2 -q -c1 $PING_HOST > /dev/null ; then + if $RG_CONNECTED >/dev/null 2>&1 ; then + echo "$(getTimestamp) Connection to $PING_HOST is up, but EAP is being bridged!" + echo -n "$(getTimestamp) Disconnecting netgraph node ... " + /usr/sbin/ngctl rmhook laneapfilter: eapout && echo "OK!" || echo "ERROR!" + fi + else + if ! $RG_CONNECTED >/dev/null 2>&1 ; then + echo "$(getTimestamp) Connection to $PING_HOST is down, but EAP is not being bridged!" + echo -n "$(getTimestamp) Connecting netgraph node ... " + /usr/sbin/ngctl connect waneapfilter: laneapfilter: eapout eapout && echo "OK!" || echo "ERROR!" + fi + fi + sleep $SLEEP + do :; done + echo "$(getTimestamp) Stopping 5268AC ping monitor ..." +} >> $LOG \ No newline at end of file