Merge to implement latest changes #1

Merged
MonkWho merged 33 commits from master into master 2020-05-03 02:30:07 +05:30
2 changed files with 40 additions and 1 deletions
Showing only changes of commit 69425b77f5 - Show all commits

View file

@ -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 `<earlyshellcmd>/root/bin/pfatt.sh</earlyshellcmd>` above `</system>`
Now edit your `/conf/config.xml` to include `<earlyshellcmd>/root/bin/pfatt.sh</earlyshellcmd>` above `</system>`.
**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!)

31
bin/pfatt-5268AC.sh Normal file
View file

@ -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