- Best free Linux router and firewall distributions of 2020
- Why is our router distro comparison better than others?
- Top 10 Open Source Firewall Software to avoid — what you should NOT use.
- 1. IPCop — avoid at all cost
- 2. Smoothwall — long dead
- 3. DD-WRT — no longer competitive
- 4. M0n0wall — retired
- 5. Tomato — not for new routers
- 6. Zeroshell — poor choice
- Not recommended because they are not user friendly
- 7. VyOS — no Web interface
- 8. OpenBSD and FreeBSD — use only if you have 10+ years of the command line experience
- 9. Debian and Ubuntu — don’t use general purpose OS for your router
- Nor recommended because they are not really free
- 10. Untangle — is it really free if OS asks you to upgrade to a paid version?
- 11. Sophos — small fish in an enterprise pond
- 12. Endian — you really have to pay to use it fully
- Best Linux/BSD Router distribution in 2020 (4 recommendations)
- 1. OPNsense — a raising star
- 2. OpenWRT — a proven veteran
- 3. pfSense — most popular
- 4. IPFire — contender
- Final verdict
- Опыт создания домашнего Wi-Fi маршрутизатора. Часть 2. Установка и настройка ПО
Best free Linux router and firewall distributions of 2020
This article has been last updated on August 3, 2020.
There are countless Free an Open Source Linux/BSD distributions to choose from for your router. However, there are many outdated recommendations on the internet, so it’s not an easy choice. For that reason, we have decided to create a definitive firewall comparison for 2020.
Wikipedia has a list of router and firewall distributions, but the list is not useful, because it’s inaccurate (as of August 2020) and it doesn’t really compare these systems in any useful way. It also lists many outdated and irrelevant systems that should be avoided in 2020.
If you are looking to get the most of your hardware appliance, or are building a new firewall, we have done the research for you.
Why is our router distro comparison better than others?
For many years we have been selling hardware for building Open Source firewalls and routers. Over the last year, we have installed and configured most, if not all the distributions out there. We install and configure pfSense, OPNSense, OpenWRT, ClearOS, IPFire, and other OSes every day, so we have a good idea which Operating systems work better than others. We don’t make any money from any software vendors, which make this recommendation relatively objective.
We hear customer feedback daily, if there are performance issues or problems with updates, we hear about it.
Top 10 Open Source Firewall Software to avoid — what you should NOT use.
Other comparisons out there are recommending Operating Systems that are long dead or no longer relevant. This is most likely because these «Top 10 Open Source Linux Firewall Software» lists are copied from year to year by non-technical users, without doing the actual comparison.
Some Operating Systems have been superseded or simply stopped being maintained and became irrelevant. You want to avoid such systems because of security reasons — these distros use outdated and have insecure Linux/BSD kernels which can potentially expose you to security exploits.
1. IPCop — avoid at all cost
Once popular operating system, included in all «top 10» lists such as this one. You should avoid using it. The last release was in 2015, and the system is ancient by today’s standards. The official website is dead, but the source code is still out there. Don’t use it.
2. Smoothwall — long dead
Smoothwall got some good reputation in the early days when it was competing with IPCop. It went silent in 2014. Smoothwall OS has been abandoned and is no longer relevant, or secure. You should avoid it. The website is still up and running, but hasn’t been updated in many years.
3. DD-WRT — no longer competitive
This is a little controversial recommendation because I know that many users still feel that DD-WRT is good. It certainly was back in the day. Today DD-WRT is still functional and works, but it’s not great or innovative. It’s mostly unchanged since 2014 and fell far behind other open source competitors. Today there are many good alternatives, such as OpenWRT.
4. M0n0wall — retired
M0n0wall is the godfather of the most successful operating systems we have today. It’s been one of the most innovative projects in its day, but it’s now retired. System hasn’t received any updates since early 2014 and is officially abandoned.
Manuel Kasper, the author of M0n0wall recommends OPNSense as its successor.
5. Tomato — not for new routers
Tomato is cool, and we love it, but it’s a minimal firmware designed for flashing off-the-shelf routers such as D-Link and Asus. The system is still relevant if you want to resurrect your old hardware and make it functional again, but if you are building a new router you probably don’t want to use tomato on it. We are building powerful routers from scratch, so we generally don’t use this system (we still love it).
6. Zeroshell — poor choice
We like the concept of Zeroshell, and we hope it succeeds, but today the system is far behind it’s competitors. The Web UI is very rudimentary, and the functionality is limited. We will keep an eye on it, and update this recommendation if things change. The website hasn’t been updated since 2018, so at the moment this project doesn’t look promising.
Not recommended because they are not user friendly
There are other systems that are relevant, and receive updates, but we still don’t recommend them, at least to less technical users.
We don’t recomment the below systems, because they require relatively high expertise to perform simple tasks. These days, SOHO routers (Small Office / Home Office) should be easy to setup and have Intuitive Web Interface to manage. For these reasons we don’t recommend the following systems:
7. VyOS — no Web interface
We love VyOS, but we highly discourage our customers from getting it, unless they really know what they are doing. This system must be managed from command line, and it requires high level of expertise to maintain and use.
8. OpenBSD and FreeBSD — use only if you have 10+ years of the command line experience
OpenBSD and FreeBSD are actively developed and are very capable, but these systems require a high level of understanding of operating system internals, and low-level networking to be used as routers.
We routinely install both systems for customers that are experts, such as network administrators or software developers. If you don’t want to mess with system internals and spend hours reading manuals, this is not a system for you. It does not provide any Web UI or GUI tools for configuration. It’s a barebones terminal based system.
9. Debian and Ubuntu — don’t use general purpose OS for your router
These systems are not intended for routers. They are general purpose operating systems, and should not really be used as routers. Similar to OpenBSD and VyOS, you will have to configure everything by hand without a Web Interface.
Nor recommended because they are not really free
There are also a few systems we don’t recommend because they are not truly free or open source.
10. Untangle — is it really free if OS asks you to upgrade to a paid version?
Untangle NG Firewall is truly great software, with many happy users. We don’t recommend it because the free version is very limited, and the operating system constantly incentivizes the users to upgrade to a paid subscription to unlock the cool functionality. The cheapest license is $50 USD/year.
11. Sophos — small fish in an enterprise pond
Sophos «XG Firewall» distribution has a very nice user interface and is free for home use. We generally don’t recommend it because it’s not a system that Sophos itself promotes. Sophos’ website seems to make it purposefully hard to find, and the community is very small. Sophos, in general, is an enterprise software company, with one community product. There’s no Open Source spirit here.
12. Endian — you really have to pay to use it fully
Endian is actually pretty cool, and free. We don’t recommend it because features like WiFi are available only in paid subscriptions. Similar to Untangle, it’s good software, but you have to pay for it — this disqualifies it from our consideration.
Best Linux/BSD Router distribution in 2020 (4 recommendations)
To choose the best Operating System for routers we have set a few basic guidelines. All systems not compatible with these guidelines have been rejected.
Basic requirements for choosing Firewall Operating System
- The system must be actively maintained, and regularly receive security patches.
- The system must be fully Free and Open Source
- The system must have a Web interface or GUI. Command line operating systems are disqualified.
- The system must be performant, and work well for a typical user.
These basic requirements are reducing the list of recommendations to 4 systems. pfSense, OpenWRT, OPNSense and IPFire.
1. OPNsense — a raising star
OPNSense is one of the most quickly developing operating systems on the market today. It’s an easy to use, mature system with slick UI. OPNSense includes most if not all features found in expensive, enterprise commercial firewalls. It has the quality of a commercial product while being completely free and open source.
It includes features not available in competing products, such as supports for WireGuard — the latest and greatest VPN software. OPNSense is based on pfSense/M0n0wall.
OPNSense offers weekly security updates, which makes is one of the most secure solutions on the market. Each year there are 2 major releases of the operating system, that bring many new features.
It’s a stable solution that we often recommend to users that are not sure which operating system to choose.
Advantages
- Best Web Interface / GUI
- Most frequently updated
- Support for features not found elsewhere
Disadvantages
OPNSense is BSD-based, which is a disadvantage in some cases;
- WiFi support is very limited. If you plan on using WiFi on your router, get Linux-based operaing sustem.
- BSD also limits the maximum throughput per connection. Single connection on OPNSense will not utilize full capacity of multi-core CPU. (this is often not important unless you have a gigabit internet connection)
2. OpenWRT — a proven veteran
OpenWRT is a Linux-based operating system for routers, recognized almost by everyone. It’s been first released in 2004, over 15 years ago and is still actively developed and maintained.
Unlike IPFire, OpenWRT has large number of optional packages in its repository. You can configure this OS in countless different ways. Most importantly, OpenWRT has drivers for all hardware supported by Linux. This means that almost all Wireless modems are supported, making it the most versatile OS for creating Access Points.
OpenWRT has the lowest hardware requirements of all operating systems we have reviewed.
Advantages
- It has the best WiFi support. It supports all the latest wireless standards and has a great Web Interface for quickly configuring and managing WiFi access points.
- Utilized all CPU cores for routing, and achieves the best routing performance
- There are about 3500 optional software packages available for installation
- It boots in about 7 seconds. Much faster than other distributions.
Disadvantages
- Its Web interface is functional, but not the most modern. It looks a little behind it’s times.
- The installation process requires more steps than other systems.
3. pfSense — most popular
pfSense is by far the most popular router operating system today. It’s a BSD-based system, similar to OPNSense, but with a much longer history. pfSense started in 2004, since then it grew to be the most well known open source platform in the industry.
pfSense has the most extensive documentation, and the biggest community, making it a good operating system to start with. There are throusands of tutorials, forums, blogs and youtube videos all over the internet that will be helpful if you get stuck on something.
Advantages
- Frequently updated, and considered solid
- Biggest community
- A large number of tutorials/documentation on the web
Disadvantages
Similar to OPNSense, pfSense is based on BSD so:
- WiFi support is very limited. If you plan on using WiFi on your router, get a Linux-based operating system.
- BSD also limits the maximum throughput per connection. A single connection on OPNSense will not utilize the full capacity of multi-core CPU. (this is often not important unless you have a gigabit internet connection)
4. IPFire — contender
IPFire is a Linux-based distribution intended for Firewalls and Routers.
IPfire is a continuation of IPCop (mentioned above) but has been rewritten from scratch. The system is regularly updated and maintained, but it doesn’t have many features found in pfSense or OPNSense. It passes all our requirements, but we recommend trying it only if the other 3 systems don’t satisfy your needs.
Advantages
- It’s Linux-based so it supports WiFi well (but not as well as OpenWRT)
- It utilized all CPU cores, making it very fast on multi-core CPUs
Disadvantages
- The Web interface is probably the worst of the 4 recommended systems. Not very modern and not intuitive.
- Harder to configure WiFi in comparison to OpenWRT.
- Very few software packages available for installation
- Not all functions can be configured via the web interface. Some require tinkering with a command line.
Final verdict
In short, if you are planning on using WiFi in your router you should choose OpenWRT. It has the absolute best support for wireless of all systems we have tested.
If you plan on using a separate Access Point and are looking for the best Open Source operating system in terms of features, documentation, community and easy to manage user interface, we strongly recommend trying OPNSense or pfSense.
Источник
Опыт создания домашнего Wi-Fi маршрутизатора. Часть 2. Установка и настройка ПО
И снова здравствуйте!
В первой части статьи я рассказывал о «железной» составляющей будущего роутера. Поскольку без софта даже самое расчудесное железо, естественно, работать не будет, следовательно требовалось снабдить аппарат соответствующей программной «начинкой».
Когда я затевал всё это движение, я предполагал, что будет непросто. Но не предполагал, что настолько. В одном из комментариев к предыдущей части статьи я клятвенно пообещал рассказать о нижеследующем «к выходным». Благоразумно умолчал к каким именно. 🙂 Тут ещё умудрился прихворнуть не вовремя, но всё-таки сдерживаю своё обещание.
- материнская плата Intel D2500CC с комплектным двухядерным 64-bit процессором Intel Atom D2500, двумя гигабитными сетевыми интерфейсами
- оперативная память SO-DIMM DDR-3 1066 4Gb Corsair
- SSD-накопитель Crucial M500 120 GB
- сетевая карта 1000 Mbit D-Link DGE-528T
- mini-PCI-E Wi-Fi карта Intel 7260.HMWWB 802.11 a/b/g/n/ac + Bluetooth 4.0
- всё это хозяйство упаковано в корпус Morex T-3460 60W
Первым делом я определил для себя круг задач, которые будет выполнять маршрутизатор, чтобы в дальнейшем мне было проще его админить.
Ещё раз уточню, что эти ваши интернеты приходят ко мне по 100 Мбитному каналу (тариф, естественно, даёт несколько меньшую скорость, но не суть). Получилось, собственно, вот что:
- Доступ в интернет со всех устройств, имеющихся дома в распоряжении +n устройств, появляющихся эпизодически или вообще однократно
- Домашняя локалка
- Соответственно, маршрутизация трафика из/в интернет/локальная сеть
- Файлохранилище (доступ по FTP или Samba)
- Торрентокачалка
- ed2k-сеть (ибо очень круто развита у провайдера)
- web-сервер
В перспективе:
- домен
- видеонаблюдение
- элементы «умного дома»
чёрт в ступемного чего интересного
Естественным в этой ситуации было выбирать из *nix-based систем. Некоторое время пришлось потратить на изучение матчасти, рыская по сети. В итоге я проделал следующий путь…
1. FreeBSD 10.1-RELEASE
Всё было замечательно, система встала, но меня ждал неприятный сюрприз, о котором я, откровенно говоря, знал, но решил-таки проверить на практике: FreeBSD напроч отказывалась видеть Wi-Fi карточку. Вернее видеть-то она её видела, но только адрес и название вендора, а что это и с чем её едят, фряха понимать не желала (драйвер устройства значился как none1). Кроме того, дальнейшее чтение мануала выявило, что в режиме точки доступа во FreeBSD работают только Wi-Fi карты на основе набора микросхем Prism. Печальбеда. Да, нашёл я также и информацию, что моя карточка в настоящий момент вообще не имеет драйвера под фряху. Даже портированного.
10. Debian 7.7.0
Расстраивался я недолго: не состоялась фряха — возьму старый добрый Debian. Установил с netinstall-образа базовую систему без графического окружения. Долго пытался понять, что не так. Стабильный релиз Debian в данный момент 7.7.0, имеет ядро версии 3.2. В этом ядре опять же нет поддержки моей многострадальной Wi-Fi сетевушки. Полез на ЛОР искать ответ, в итоге получил неутешительные выводы: надо ставить ядро посвежее (в случае Debian — тот ещё геморрой), пляски с бубном ядрами, по мнению гуру, не труъ Debian-way (так прямо и сказали: хочешь перекомпилять ядра — выбери другой дистрибутив).
11. Ubuntu Server 14.04 LTS
Плюнув на попытки круто провести время покрасноглазить, я взял знакомый и уважаемый мной дистрибутив. Уже более года он (правда версии 12.04 LTS ) вертится у меня на сервере, раздающем плюшки в сети провайдера.
Из плюсов: стабильность, простота установки, настройки и администрирования, куча документации.
Из минусов: необходимость дорабатывать напильником, поскольку «искаропки» получается толстоват и несколько неповоротлив.
Установка
По сути не представляет ничего сложного и аналогична таковой в Debian. Производится в диалоговом режиме text-mode. Описывать детально не вижу смысла, т.к. всё это уже десятки раз пережёвано и валяется на множестве ресурсов (начиная с официальных сайтов на разных языках и заканчивая местечковыми форумами).
Перед началом любых манипуляций с накопителем рекомендуется обновить прошивку, но на моём оказалась самая свежая, поэтому данный шаг я пропустил.
Первой необходимой манипуляцией при разметке накопителя является выравнивание разделов диска. Если кратко, то каждый раздел должен начинаться с сектора кратного 8. Первый раздел рекомендовано начинать с 2048 сектора (это связано с расположением в начале накопителя MBR или GPT , а «отступ» в 1 Мб берётся с запасом.
При разметке я создал 3 раздела:
Как видно, все разделы начинаются с секторов, кратных 8. Таким образом доступ будет осуществляться с обращением по правильному сектору, что поможет сберечь нежный ресурс накопителя.
Далее в опциях монтирования разделов в /etc/fstab следует добавить discard — для включения TRIM и noatime — для отключения записи в метаданные времени последнего доступа к файлу.
Все остальные советы, нагугленные на просторах сети, как то увеличение времени между сбросами буферов на диск (опция commit=[time, sec.]), отключение «шлагбаума» (опция barrier=0) и прочее не внушили мне доверия в плане приобретаемой полезности в ущерб сохранности данных и безопасности.
Кроме того, я не стал выделять отдельный раздел для swap, решив, что оперативной памяти мне должно хватить для поставленных задач. Если же всё-таки возникнет необходимость в подкачке, ничто не мешает сделать swap в виде файла и смонтировать его как раздел.
Также было принято волевое решение вынести временные файлы (/tmp) в tmpfs.
В процессе установки задаются общие параметры, как то: локаль, параметры времени/геопозиции, имя системы, а также создаётся новый юзер и пароль к нему. Далее следует выбор устанавливаемого программного обеспечения, в котором я пометил для установки следующее:
- OpenSSH server
- DNS server
- LAMP server
- Print server
- Samba file server
После загрузки в свежеустановленную систему проявилась одна крайне неприятная особенность (кстати, в Debian было то же самое): после инициализации драйверов вырубалось видео, монитор переходил в режим ожидания, и становилось непонятно система зависла или просто что-то не так с выводом. Обнаружилось, что доступ по ssh есть, и можно было бы на этом остановиться, но всегда может возникнуть ситуация, когда необходимо получить физический доступ к маршрутизатору (например, шаловливые ручонки админа поковырялись в настройках сети, и доступ через консоль категорически пропал %) ). Посёрфиф по форумам я наткнулся на решение (оказывается баг известен и проявляется именно на этой материнской плате):
add to /etc/modprobe.d/blacklist.conf:
blacklist gma500_gfx
run
sudo update-initramfs -u
sudo reboot
Пруф.
В случае с Debian — /etc/modprobe.d/fbdev-blacklist.conf.
После перезагрузки всё заработало.
Настройка сети
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
Проблема связана с библиотекой авторизации libpam-smbpass, можно просто её снести, а можно поступить более изящно:
снять пометку с SMB password synchronization, что отключает синхронизацию паролей системных пользователей и пользователей Samba.
Устанавливаем все доступные обновления:
И приступаем к настройке сетевых интерфейсов. В маршрутизаторе 4 физических интерфейса и loopback:
- eth0 — «смотрит» в интернет, получает настройки по DHCP
- eth1 и em0 — интегрированные в материнку сетевые адаптеры
- wlan0 — как нетрудно догадаться, беспроводной интерфейс Wi-Fi
Устанавливаем hostapd и переводим беспроводной интерфейс в режим Master:
К моему величайшему сожалению такой способ не сработал, и команда вывалилась с ошибкой, поэтому я прибегнул к альтернативному способу:
Теперь необходимо сконфигурировать все сетевые интерфейсы, чтобы было удобнее с ними работать. Я решил объединить встроенные сетевушки и Wi-Fi в мост, чтобы управлять этим хозяйством как единым целым при раздаче IP-адресов по DHCP, маршрутизации и пр. Приводим к следующему виду /etc/network/interfaces:
Включаем автоматический запуск hostapd при загрузке системы, для этого в /etc/default/hostapd раскомментируем и редактируем строки:
Далее, не мудрствуя лукаво, я настроил общий доступ. Скрипт для настройки iptables и ip-форвардинга я взял отсюда, привёл его в соответствие своим реалиям и настроил автозапуск. В результате iptables наполняются необходимым содержимым при загрузке системы.
Логично, что нужно текже настроить DHCP-сервер. Решив упростить задачу до минимума, я установил dnsmasq и снёс имеющийся в наличии и конфликтующий с ним bind9. Конфиг прост:
На самом деле в конфиге ещё куча закомментированных опций, которые позволяют производить очень fine tuning, но такого набора вполне хватает для корректной работы. В принципе, с этого момента аппарат уже работает как домашний маршрутизатор.
После окончания основной настройки я установил и настроил transmission-daemon, aMuled и vsftpd. Собственно говоря, настройка данных сервисов достаточно тривиальна, останавливаться детально на ней не буду. Естественно, доступ к данным ресурсам имеется только из локальной сети, если хочется получить доступ извне, необходимо будет открыть соответствующие порты в iptables.
Вёб-сервер представляет из себя связку Apache 2.4.7 + MySQL Ver 14.14 Distrib 5.5.40. Пока не придумал, чем буду его заполнять: накатить готовый движок и баловаться с дизайном или же просто попрактиковаться в html и php. В любом случае сие имеет для меня прикладное значение. Возможно, в перспективе получится настроить вёб-интерфейс для мониторинга и управления маршрутизатором.
После всех манипуляций остаётся настроить ведение логов: по возможности привести настройки всех процессов, ведущих логи, выводить в них только критически важные уведомления и предупреждения. Идея заключается в снижении количества операций записи, а, соответственно, и негативного влияния на SSD.
Кроме того, следует настоятельно рекомендуется включить запуск по cron раз в сутки fstrim (для каждого раздела отдельно). Говорят, хуже не будет точно.
Ффух… Получилось несколько сумбурное описание моих мытарств с собственноручно собранным устройством, но удовлетворение от того, что всё работает просто неописуемо.
В комментарии к предыдущей части статьи многоуважаемый dmitrmax интересовался уровнем энергопотребления сборки. Ну что же, привожу примерные данные, которые мне удалось почерпнуть из открытых источников:
- процессор Intel Atom D2500 — до 10 Вт
- SSD-накопитель Crucial M500 — 3,6 Вт
По остальным крмплектующим данных сходу не нашлось, но практически везде в характеристиках сетевой карты и Wi-Fi модуля пишут «низкое энергопотребление». Если грубо накинуть на всё про всё 10 Вт (прочее железо, интегрированные сетевушки, etc), то итого получается около 25 Вт — не так уж и много, полагаю…
Вроде бы ничего не забыл, упомянул все ключевые моменты. За подробностями прошу в комментарии. Спасибо за внимание! (-;
UPD: Господин Revertis справедливо заметил, и я с ним соглашусь, что изначально при установке системы не следовало отмечать DNS-сервер, чтобы потом его сносить (речь о bind9), но в статье я описывал именно путь, который проделал — со всеми его ошибками и закоулками. И да, соглашусь, что nginx лучше, чем Apache, более того — я его даже заменю. Спасибо за совет.
Источник