[arm-allstar] Blocking incoming specific IP's

Doug Crompton wa3dsp at gmail.com
Sun Aug 19 14:05:10 EDT 2018


OK here is an example script to take your list and apply it to iptables -

#!/bin/bash

if [ -z $1 ]
  then
    echo "NO file name given"
    exit
fi

filename="$1"
while read -r IP
do
    if [ ! -z $IP  ]
      then
        echo "Adding IP - $IP to iptables"
#       iptables -A INPUT -i eth0 -s $IP -j DROP
    fi
done < "$filename"
echo
iptables -L
# END of script

and the sample IP list I created in ip.txt -

192.168.0.2
192.168.2.3
192.168.4.9

called the script as - block_address.sh ip.txt

NOTE that the iptables line is commented for testing. Remove the # after
testing with your list for it to work.


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*


On Sun, Aug 19, 2018 at 1:35 PM, "Mr. Possum (Bill) via arm-allstar" <
arm-allstar at hamvoip.org> wrote:

> That would be the best way to do it - in the router...  But unfortunately
> I do not have easy access to the router in order to be able to make any
> changes like that.  It belongs to a Volunteer Fire Department at the
> station that the repeater is located at.
>
> So I need to block it at the Raspberry Pi for now...
>
> Bill - N5MBM
>
>       From: James Hause via arm-allstar <arm-allstar at hamvoip.org>
>  To: ARM Allstar <arm-allstar at hamvoip.org>
> Cc: James Hause <hausejd at gmail.com>
>  Sent: Sunday, August 19, 2018 12:23 PM
>  Subject: Re: [arm-allstar] Blocking incoming specific IP's
>
> Hi Bill,
>   I am not an expert on this at all, so hopefully you will get a better
> answer.
> Believe the router that I have my simplex node allows one to go into
> advanced settings and block static IP addresses.
> Jim
>
> On Sun, Aug 19, 2018 at 11:08 AM, "Mr. Possum (Bill) via arm-allstar" <
> arm-allstar at hamvoip.org> wrote:
>
> > When I was working on one of my nodes this morning I noticed that I am
> > getting HAMMERED by some IP over in france that has been reported for
> IPBX
> > probing....
> > Here's the output on my CLI -
> >
> >
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> >  == Connect attempt from '212.83.150.74' unable to authenticate
> > Independence*CLI>
> >
> > It hits every couple of seconds...
> > Here's the info on the Ip address - https://www.abuseipdb.com/
> > check/212.83.150.74
> > What I would like to do is use something like ipset to just block that
> > specific IP address....  But I find that ipset isn't on our little RasPi
> > images...
> > So, does anyone have a suggestion to easily block some IP's off of a
> list?
> > Thanks!
> > Bill - N5MBM
> >
> >
> >
> >
> > _______________________________________________
> >
> > arm-allstar mailing list
> > arm-allstar at hamvoip.org
> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >
> > Visit the BBB and RPi2/3 web page - http://hamvoip.org
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
>
>
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org


More information about the arm-allstar mailing list