What's new

Aegis aegis: a firewall blocklist

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

What happens when you run

"aegis upgrade"
I know aegis 1.1.4 is installed on my usb drive,that will just upgrade internally

oot@R7800:/$ aegis upgrade
Upgrading:
- Version installed: 1.0.3
- Version found: 1.1.4
? Do you want to upgrade from 1.0.3 to 1.1.4 (y/n)?
 
Ok, clearly at some point, something got messed up.
The aegis in your internal drive is not installed in the right place /root/bolemo...
So it is a mystery where it is and how it ended up there...

Can you do this:
Code:
ls -l /opt/bolemo
And this:
Code:
ls -l /usr/bin/aegis

It will tell where the symlink is pointing to for your internal aegis.
From there, we can figure out how to uninstall this copy.
 
Ok, clearly at some point, something got messed up.
The aegis in your internal drive is not installed in the right place /root/bolemo...
So it is a mystery where it is and how it ended up there...

Can you do this:
Code:
ls -l /opt/bolemo
And this:
Code:
ls -l /usr/bin/aegis

It will tell where the symlink is pointing to for your internal aegis.
From there, we can figure out how to uninstall this copy.
This is what I get

root@R7800:/$
root@R7800:/$ ls -l /opt/bolemo
lrwxrwxrwx 1 root root 20 May 27 19:30 /opt/bolemo -> /tmp/mnt/sdb1/bolemo
root@R7800:/$
root@R7800:/$ ls -l /usr/bin/aegis
lrwxrwxrwx 1 root root 25 May 27 19:30 /usr/bin/aegis -> /opt/bolemo/scripts/aegis
root@R7800:/$
root@R7800:/$
 
All of that is right.

It means that aegis is installed on external drive.
So you have version 1.0.3 on your external drive sdb1.

I would do a reinstall from install script.

This is what I get

root@R7800:/$
root@R7800:/$ ls -l /opt/bolemo
lrwxrwxrwx 1 root root 20 May 27 19:30 /opt/bolemo -> /tmp/mnt/sdb1/bolemo
root@R7800:/$
root@R7800:/$ ls -l /usr/bin/aegis
lrwxrwxrwx 1 root root 25 May 27 19:30 /usr/bin/aegis -> /opt/bolemo/scripts/aegis
root@R7800:/$
root@R7800:/$
 
All of that is right.

It means that aegis is installed on external drive.
So you have version 1.0.3 on your external drive sdb1.

I would do a reinstall from install script.
Ok I get this now. Dont understand whats happened to the internal aegis and things are still not right. Might do a factory reset and start again

root@R7800:/$
root@R7800:/$ wget -qO- https://github.com/bolemo/aegis/raw/master/aegis-install.sh | sh
Where do you want to install aegis?
0 - router internal memory (rootfs)
1 - external drive: /mnt/sda1
2 - external drive: /mnt/sdb1
c - cancel installation
Your choice: 2

aegis will be installed on external drive /tmp/mnt/sdb1
Creating directory (if not already existing): /opt/scripts
Creating directory (if not already existing): /tmp/mnt/sdb1/bolemo
Creating symlink (if not already existing): /opt/bolemo
Creating subdirectories in bolemo: scripts, etc
Downloading and installing aegis...
An aegis sources file already exists, keeping it.
iprange is installed.
Done!

root@R7800:/$
root@R7800:/$ aegis info
Info:
- 'aegis' version 1.1.4 is installed on external drive.
- 'aegis' is in PATH.
- This is the last version.
- 'iprange' is installed: iprange 1.0.4
root@R7800:/$
root@R7800:/$ aegis status
Status:
- 'aegis' version: 1.1.4
- 'iprange' is installed: iprange 1.0.4
- Something is not right with iptables setup! Use 'aegis -v status' for more details
- Logging is off.
root@R7800:/$



root@R7800:/$
root@R7800:/$ aegis -v status
aegis 1.1.4 - Verbose mode
Status:
- 'aegis' version: 1.1.4
- 'iprange' is installed: iprange 1.0.4
- Something is not right with iptables setup! Use 'aegis -v status' for more details
- Logging is off.
Detailed status:
- 'firewall-start.sh' exists with correct settings.
- 'post-mount.sh' exists with correct settings.
- Actual router time: 2020-05-29 19:24:45
- Blocklist generation time: 2020-05-26 03:15:04
- Router firewall was last started 2020-05-29 18:43:23:
ipset blocklist was already loaded.
outbound iptables rules were already set!
iptables logging rules were set.
- iptables rules are not set properly:
iptables rules are not set for VPN tunnel
iptables -N aegis_DROP
iptables -A INPUT -i brwan -m set --match-set aegis_BL src -j aegis_DROP
iptables -A FORWARD -i brwan -m set --match-set aegis_BL src -j aegis_DROP
iptables -A FORWARD -o brwan -m set --match-set aegis_BL dst -j aegis_DROP
iptables -A OUTPUT -o brwan -m set --match-set aegis_BL dst -j aegis_DROP
iptables -A aegis_DROP -j LOG --log-prefix "[aegis] "
iptables -A aegis_DROP -j DROP
- Logging is inactive.
- ipset blocklist is not set.
- ipset whitelist is not set.
- ipset WAN gateway bypass is not set.
root@R7800:/$
root@R7800:/$
 
Good :)

Now, just do
Code:
aegis clean -v
And
Code:
aegis update -v
PS: you have 2 external drives. Maybe you had aegis on both...
PSS: no need to factory reset

Ok I get this now. Dont understand whats happened to the internal aegis and things are still not right. Might do a factory reset and start again

root@R7800:/$
root@R7800:/$ wget -qO- https://github.com/bolemo/aegis/raw/master/aegis-install.sh | sh
Where do you want to install aegis?
0 - router internal memory (rootfs)
1 - external drive: /mnt/sda1
2 - external drive: /mnt/sdb1
c - cancel installation
Your choice: 2

aegis will be installed on external drive /tmp/mnt/sdb1
Creating directory (if not already existing): /opt/scripts
Creating directory (if not already existing): /tmp/mnt/sdb1/bolemo
Creating symlink (if not already existing): /opt/bolemo
Creating subdirectories in bolemo: scripts, etc
Downloading and installing aegis...
An aegis sources file already exists, keeping it.
iprange is installed.
Done!

root@R7800:/$
root@R7800:/$ aegis info
Info:
- 'aegis' version 1.1.4 is installed on external drive.
- 'aegis' is in PATH.
- This is the last version.
- 'iprange' is installed: iprange 1.0.4
root@R7800:/$
root@R7800:/$ aegis status
Status:
- 'aegis' version: 1.1.4
- 'iprange' is installed: iprange 1.0.4
- Something is not right with iptables setup! Use 'aegis -v status' for more details
- Logging is off.
root@R7800:/$



root@R7800:/$
root@R7800:/$ aegis -v status
aegis 1.1.4 - Verbose mode
Status:
- 'aegis' version: 1.1.4
- 'iprange' is installed: iprange 1.0.4
- Something is not right with iptables setup! Use 'aegis -v status' for more details
- Logging is off.
Detailed status:
- 'firewall-start.sh' exists with correct settings.
- 'post-mount.sh' exists with correct settings.
- Actual router time: 2020-05-29 19:24:45
- Blocklist generation time: 2020-05-26 03:15:04
- Router firewall was last started 2020-05-29 18:43:23:
ipset blocklist was already loaded.
outbound iptables rules were already set!
iptables logging rules were set.
- iptables rules are not set properly:
iptables rules are not set for VPN tunnel
iptables -N aegis_DROP
iptables -A INPUT -i brwan -m set --match-set aegis_BL src -j aegis_DROP
iptables -A FORWARD -i brwan -m set --match-set aegis_BL src -j aegis_DROP
iptables -A FORWARD -o brwan -m set --match-set aegis_BL dst -j aegis_DROP
iptables -A OUTPUT -o brwan -m set --match-set aegis_BL dst -j aegis_DROP
iptables -A aegis_DROP -j LOG --log-prefix "[aegis] "
iptables -A aegis_DROP -j DROP
- Logging is inactive.
- ipset blocklist is not set.
- ipset whitelist is not set.
- ipset WAN gateway bypass is not set.
root@R7800:/$
root@R7800:/$
 
Last edited:
All good.

Have a nice week-end @jrbmw
 
  • Like
Reactions: KW.
Aegis does it job so good. Not that i've ever doubted it. When I forgot all about this pearl of a software as its just do its work in shadows and with no drawback I was reminded when a streaming software stopped working and it didn't got a connection.

Then Aegis entered my mind again. As this pearl is build in such a well thought out way I got the blocked ip:s from the log and could whitelist them and all is now fine. It's all in the readme but as Im not as accurate as this software I had to run to HELLO wORLD. Great service comes with the software and he pointed out my typo in the file name.

Thanks HELLO wORLD for a great neat software with lovely simple commands and thank you for your service. My only problem now is if I should use that streaming software and why the IP:s was blacklisted. But that is my headache and its really valuable to have a shield that forces you to stop up and think and make conscious decisions. I recommend Aegis to everyone who can use it.
 
@Jauger, probably not, like all the other (more important) stickies just get ignored too.
 
installed on usb ........ but from error help




Code:
root@R9000:/$ aegis info

Info:

- 'aegis' version 1.1.4 is installed on external drive.

- 'aegis' is in PATH.

- This is the last version.

- 'iprange' is installed: iprange 1.0.4

root@R9000:/$

root@R9000:/$ aegis update -v

aegis 1.1.4 - Verbose mode

Initializing...

- 'firewall-start.sh' is in place and ok.

- 'aegis' is installed on external drive.

- 'post-mount.sh' is in place and ok.

Updating blocklist from sources...

- Downloading lists defined in /opt/bolemo/etc/aegis.sources

1) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset

-                   100%[===================>]  41.56K  --.-KB/s    in 0.002s



2) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level2.netset

-                   100%[===================>] 291.01K  --.-KB/s    in 0.01s



3) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level3.netset

-                   100%[===================>] 263.96K  --.-KB/s    in 0.01s



4) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/iblocklist_ciarmy_malicious.netset

-                   100%[===================>] 202.01K  --.-KB/s    in 0.02s



5) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/malwaredomainlist.ipset

-                   100%[===================>]  14.49K  --.-KB/s    in 0.001s



- Optimizing and reducing netset (using iprange)...

- Done.

Building ipset blocklist (49740 entries blocking 619488609 ips)...

- Created blocklist, swapping it.

- Done.

- Internal firewall needs to be restarted...

Restarting firewall...

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found

- Firewall restarted.

Status:

- 'aegis' version: 1.1.4

- 'iprange' is installed: iprange 1.0.4

- Something is not right! Use 'aegis -v status' for more details

- Logging is off.

Detailed status:

- 'firewall-start.sh' exists with correct settings.

- 'post-mount.sh' exists with correct settings.

- Actual router time: 2020-10-19 21:59:37

- Blocklist generation time: 2020-10-19 21:59:37

- No status file found.

- iptables rules are not set.

- Logging is inactive.

- ipset blocklist is set:

     Name: aegis_bl

     Type: hash:net

     Revision: 6

     Header: family inet hashsize 16384 maxelem 49740

     Size in memory: 1053748

     References: 0

     Number of entries: 49740

- ipset whitelist is not set.

- ipset WAN gateway bypass is not set.

root@R9000:/$

root@R9000:/$ aegis status -v

aegis 1.1.4 - Verbose mode

Status:

- 'aegis' version: 1.1.4

- 'iprange' is installed: iprange 1.0.4

- Something is not right! Use 'aegis -v status' for more details

- Logging is off.

Detailed status:

- 'firewall-start.sh' exists with correct settings.

- 'post-mount.sh' exists with correct settings.

- Actual router time: 2020-10-19 22:00:00

- Blocklist generation time: 2020-10-19 22:00:00

- No status file found.

- iptables rules are not set.

- Logging is inactive.

- ipset blocklist is set:

     Name: aegis_bl

     Type: hash:net

     Revision: 6

     Header: family inet hashsize 16384 maxelem 49740

     Size in memory: 1053748

     References: 0

     Number of entries: 49740

- ipset whitelist is not set.

- ipset WAN gateway bypass is not set.

root@R9000:/$

root@R9000:/$ aegis info

Info:

- 'aegis' version 1.1.4 is installed on external drive.

- 'aegis' is in PATH.

- This is the last version.

- 'iprange' is installed: iprange 1.0.4

root@R9000:/$

root@R9000:/$ net-wall restart

Starting Firewall...

Done!

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found

root@R9000:/$



[CODE]root@R9000:/$ ls -l /mnt

lrwxrwxrwx    1 root     root            8 Sep  2 17:44 /mnt -> /tmp/mnt

root@R9000:/$

root@R9000:/$ ls -l /mnt/UNTITLED/

ls: /mnt/UNTITLED/: No such file or directory

root@R9000:/$

root@R9000:/$ ls -l /mnt/

lrwxrwxrwx    1 root     root            4 Oct 19 21:37 New_Volume -> sdc1

drwxrwxrwx    1 root     root         4096 Oct 19 11:28 sdc1

root@R9000:/$

root@R9000:/$ ls -l /mnt/sdc1/bolemo/*

/mnt/sdc1/bolemo/etc:

-rwxrwxrwx    1 root     root       719046 Oct 19 21:59 aegis-bl.netset

-rwxrwxrwx    1 root     root          455 Oct 19 11:14 aegis.sources



/mnt/sdc1/bolemo/scripts:

-rwxrwxrwx    1 root     root        34932 Oct 19 21:04 aegis



/mnt/sdc1/bolemo/www:

-rwxrwxrwx    1 root     root         1052 Oct 19 12:30 aegis.htm

root@R9000:/$

root@R9000:/$ cd /opt

root@R9000:/opt$

root@R9000:/opt$ ls -l bolemo/*

bolemo/etc:

-rwxrwxrwx    1 root     root       719046 Oct 19 21:59 aegis-bl.netset

-rwxrwxrwx    1 root     root          455 Oct 19 11:14 aegis.sources



bolemo/scripts:

-rwxrwxrwx    1 root     root        34932 Oct 19 21:04 aegis



bolemo/www:

-rwxrwxrwx    1 root     root         1052 Oct 19 12:30 aegis.htm
[/CODE]
 
It looks like the problem is not coming from aegis, but from when the firewall is restarted.

Can you first check if /opt/scripts/firewall-start.sh exists and cat its content?
In this line (returned by firewall restart, not aegis):
Bash:
/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found
It seems that the built-in firewall script is not able to find firewall-start.sh


installed on usb ........ but from error help




Code:
root@R9000:/$ aegis info

Info:

- 'aegis' version 1.1.4 is installed on external drive.

- 'aegis' is in PATH.

- This is the last version.

- 'iprange' is installed: iprange 1.0.4

root@R9000:/$

root@R9000:/$ aegis update -v

aegis 1.1.4 - Verbose mode

Initializing...

- 'firewall-start.sh' is in place and ok.

- 'aegis' is installed on external drive.

- 'post-mount.sh' is in place and ok.

Updating blocklist from sources...

- Downloading lists defined in /opt/bolemo/etc/aegis.sources

1) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset

-                   100%[===================>]  41.56K  --.-KB/s    in 0.002s



2) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level2.netset

-                   100%[===================>] 291.01K  --.-KB/s    in 0.01s



3) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level3.netset

-                   100%[===================>] 263.96K  --.-KB/s    in 0.01s



4) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/iblocklist_ciarmy_malicious.netset

-                   100%[===================>] 202.01K  --.-KB/s    in 0.02s



5) https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/malwaredomainlist.ipset

-                   100%[===================>]  14.49K  --.-KB/s    in 0.001s



- Optimizing and reducing netset (using iprange)...

- Done.

Building ipset blocklist (49740 entries blocking 619488609 ips)...

- Created blocklist, swapping it.

- Done.

- Internal firewall needs to be restarted...

Restarting firewall...

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found

- Firewall restarted.

Status:

- 'aegis' version: 1.1.4

- 'iprange' is installed: iprange 1.0.4

- Something is not right! Use 'aegis -v status' for more details

- Logging is off.

Detailed status:

- 'firewall-start.sh' exists with correct settings.

- 'post-mount.sh' exists with correct settings.

- Actual router time: 2020-10-19 21:59:37

- Blocklist generation time: 2020-10-19 21:59:37

- No status file found.

- iptables rules are not set.

- Logging is inactive.

- ipset blocklist is set:

     Name: aegis_bl

     Type: hash:net

     Revision: 6

     Header: family inet hashsize 16384 maxelem 49740

     Size in memory: 1053748

     References: 0

     Number of entries: 49740

- ipset whitelist is not set.

- ipset WAN gateway bypass is not set.

root@R9000:/$

root@R9000:/$ aegis status -v

aegis 1.1.4 - Verbose mode

Status:

- 'aegis' version: 1.1.4

- 'iprange' is installed: iprange 1.0.4

- Something is not right! Use 'aegis -v status' for more details

- Logging is off.

Detailed status:

- 'firewall-start.sh' exists with correct settings.

- 'post-mount.sh' exists with correct settings.

- Actual router time: 2020-10-19 22:00:00

- Blocklist generation time: 2020-10-19 22:00:00

- No status file found.

- iptables rules are not set.

- Logging is inactive.

- ipset blocklist is set:

     Name: aegis_bl

     Type: hash:net

     Revision: 6

     Header: family inet hashsize 16384 maxelem 49740

     Size in memory: 1053748

     References: 0

     Number of entries: 49740

- ipset whitelist is not set.

- ipset WAN gateway bypass is not set.

root@R9000:/$

root@R9000:/$ aegis info

Info:

- 'aegis' version 1.1.4 is installed on external drive.

- 'aegis' is in PATH.

- This is the last version.

- 'iprange' is installed: iprange 1.0.4

root@R9000:/$

root@R9000:/$ net-wall restart

Starting Firewall...

Done!

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found

/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found

root@R9000:/$



[CODE]root@R9000:/$ ls -l /mnt

lrwxrwxrwx    1 root     root            8 Sep  2 17:44 /mnt -> /tmp/mnt

root@R9000:/$

root@R9000:/$ ls -l /mnt/UNTITLED/

ls: /mnt/UNTITLED/: No such file or directory

root@R9000:/$

root@R9000:/$ ls -l /mnt/

lrwxrwxrwx    1 root     root            4 Oct 19 21:37 New_Volume -> sdc1

drwxrwxrwx    1 root     root         4096 Oct 19 11:28 sdc1

root@R9000:/$

root@R9000:/$ ls -l /mnt/sdc1/bolemo/*

/mnt/sdc1/bolemo/etc:

-rwxrwxrwx    1 root     root       719046 Oct 19 21:59 aegis-bl.netset

-rwxrwxrwx    1 root     root          455 Oct 19 11:14 aegis.sources



/mnt/sdc1/bolemo/scripts:

-rwxrwxrwx    1 root     root        34932 Oct 19 21:04 aegis



/mnt/sdc1/bolemo/www:

-rwxrwxrwx    1 root     root         1052 Oct 19 12:30 aegis.htm

root@R9000:/$

root@R9000:/$ cd /opt

root@R9000:/opt$

root@R9000:/opt$ ls -l bolemo/*

bolemo/etc:

-rwxrwxrwx    1 root     root       719046 Oct 19 21:59 aegis-bl.netset

-rwxrwxrwx    1 root     root          455 Oct 19 11:14 aegis.sources



bolemo/scripts:

-rwxrwxrwx    1 root     root        34932 Oct 19 21:04 aegis



bolemo/www:

-rwxrwxrwx    1 root     root         1052 Oct 19 12:30 aegis.htm
[/CODE]
 
  • Like
Reactions: KW.
Code:
root@R9000:/$ cd /opt/scripts/
root@R9000:/opt/scripts$
root@R9000:/opt/scripts$ ls
firewall-start-adguardhome.sh  firewall-start.sh
firewall-start-bwusage.sh
root@R9000:/opt/scripts$
root@R9000:/opt/scripts$ vi firewall-start.sh
#!/bin/bash
iptables -I INPUT -s 51.79.162.132 -j DROP
iptables -I INPUT -s 51.79.142.79 -j DROP
iptables -A INPUT -p tcp --destination-port 50002 -j DROP



# Bolemo aegis
[ -x /opt/bolemo/scripts/aegis ] && /opt/bolemo/scripts/aegis _fws
~
~
~
~
~
~
~
~
~
~
~
~
~
~
 
Thank you.

First, the shebang should be #!/bin/sh (not bash), but that should not be the problem here.
Aegis did install its link, so the problem is definitely not aegis.

What happens when you run
Code:
net-wall restart
 
  • Like
Reactions: KW.
root@R9000:/$ net-wall restart
Starting Firewall...
Done!
/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found
/bin/sh: /etc/appflow/streamboost.d/40_qdiscman: not found
/usr/sbin/net-wall: /usr/sbin/net-wall: 107: /opt/scripts/firewall-start.sh: not found
root@R9000:/$
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top