Endian firewall community настройка vpn
Welcome to our guide on how to install and configure Endian Firewall on VirtualBox. Endian Firewall Community (EFW) is an open-source Red Har Enterprise Linux (RHEL) based security software offering a stateful packet firewall, basic web and email security, open-source antivirus and powerful VPN (IPsec and SSL). It also provides a live network monitoring and reporting that allows you to visualize and monitor traffic on your network in real-time
Install and Configure Endian Firewall on VirtualBox
This guide focuses on the installation and configuration of the open-source version of Endian Firewall on VirtualBox.
EFW initial Configuration
Configure Client Network Settings
In this guide, we are accessing our EFW from an Ubuntu 18.04 system whose network is configured as shown below;
To verify that you reach the Endian Firewall from the client system, you can try to ping it as shown below;
Не так давно в статье Настройка OpenVPN сервера мы писали о том, как поднять и настроить OpenVPN сервер под Windows. На днях пришлось столкнуться с задачей переноса настроенного OpenVPN сервера на софтовый роутер под управлением Endian Firewall Community 2.5.1. В этом посте мы рассмотрим некоторые моменты, которые касаются непосредственно переноса. Итак, EFW, как и любой другой полноценный софтроутер имеет в своем составе OpenVPN, который можно настроить и в качестве сервера, и в качестве клиента. Но как быть, если ключи и сертификаты у нас уже сгенерированы и мы уже имеем рабочий инстанс OpenVPN?
Для этого напишем небольшой пакетный сценарий:
make-pkcs12.bat
@echo off
cd %HOME%
rem convert the key/cert and embed the ca cert into a pkcs12 file.
openssl pkcs12 -export -inkey %KEY_DIR%\%1.key -in %KEY_DIR%\%1.crt -certfile %KEY_DIR%\ca.crt -out %KEY_DIR%\%1.p12
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
Выполнив его для серверного ключа make-pkcs12 Server (предварительно не забываем запустить vars.bat для инициализации переменных) на выходе получим файл Server.p12, готовый для импорта в EFW. Заходим в меню VPN -> OpenVPN Server -> Advanced в EFW и в разделе Authentication settings -> Certificate management с помощью Import server certificate from external Certification Authority (CA) импортируем сертификат сервера. Одновременно с сертификатом сервера импортируется ключ сервера, и сертификат CA (Certification Authority). Далее в Advanced settings настраиваем порт и протокол на котором у нас будет находиться OpenVPN сервер, а также другие параметры.
В Authentication settings -> Authentication type выбираем что аутентификация у нас будет производиться по X.509 certificate.
Теперь нам придется столкнуться с другой проблемой, в статье в конфигах у нас используется tls-auth, настройку которого из Web GUI EFW 2.5.1 поддерживает только для клиентских OpenVPN подключений. Т.е. если мы настраиваем сервер, то из web-интерфейса мы никак не сможем указать EFW что надо использовать наш ta.key.
Как в EFW при настройке OpenVPN сервера использовать tls-auth?
Не беда. Правда, нам потребуются небольшие знания Linux и умение работать в командной строке. Подключаемся к EFW по SSH и в /etc/openvpn/openvpn.conf.tmpl (это шаблон файла конфигурации, из него при сохранении настроек OpenVPN сервера через web-интерфейс формируется основной файл конфигурации OpenVPN сервера - /etc/openvpn/openvpn.conf) меняем следующий кусок:
Т.е. здесь мы закомментировали строчку ns-cert-type client и добавили строчку tls-auth /var/efw/openvpn/ta.key 0. Что это дает? При формировании конфига openvpn.conf, если мы используем метод авторизации по сертификатам в openvpn.conf будет добавлена строка tls-auth /var/efw/openvpn/ta.key 0. Соответственно наш файл ta.key нам необходимо будет поместить в /var/efw/openvpn/. TLS побежден. Рассмотрим еще один вопрос.
Как подключить к EFW (Endian Firewall Community) репозиторий? Как устанавливать в EFW пакеты?
Наверное каждый, кто занимается администрированием EFW задумывался над тем, что было бы удобно добавить туда те же wget или mc, на самом деле такой способ есть. Можно подключить репозиторий от CentOS. Для этого заходим по SSH, набираем команду login чтобы попасть в полноценную linux'овую консоль и далее в ней:
smart config –-set rpm-check-signatures=False
smart channel --remove centos-4
smart channel --add сentos-4 baseurl="http://vault.centos.org/4.9/os/i386/" type=rpm-md -y
smart update
smart install wget
smart install mc
Ну и напоследок.
Как настроить GREEN IP из консоли?
Все. EFW у нас теперь с адресом 192.168.10.15 до следующей перезагрузки. Теперь к нему можно получить доступ из требуемой нам сети и сконфигурировать.
Где хранятся настройки интерфейса GREEN?
Чтобы быстро изменить настройки GREEN интерфейса (можно попробовать изменить их через Web GUI в System -> Network configuration -> Network setup wizard, однако мне он там сначала предлагал сконфигурировать интерфейс RED, настройки которого мне менять совершенно не хотелось) можно воспользоваться SSH. Настройки интерфейсов содержатся в /var/efw/ethernet/settings в виде:
Соответственно, например, можно добавить "алиас" на GREEN интерфейс. Например, если нам нужно чтобы у нас EFW на интерфейсе GREEN отзывался и на 192.168.10.254, и на 192.168.9.1, нужно в GREEN_IPS через запятую указать требуемые IP, например - GREEN_IPS=192.168.10.254/24,192.168.9.1/24. Сохранить файл и перезагрузить ПК с EFW. После перезагрузки на интерфейсе GREEN (br0) будет уже два IP.
Хотел что-то еще рассказать, но это уже пост по настройке EFW получается, а не про перенос OpenVPN под EFW, поэтому, пожалуй на сегодня на этом и остановимся.
В одной из "статей" на нашем форуме Перенос OpenVPN сервера на Endian Firewall Community, "Твики" настройки EFW 2.5.1 мы писали о том как перенести существующий OpenVPN сервер на EFW, использовав при этом tls-auth. Сегодня я расскажу о том, как правильно сконфигурировать OpenVPN сервер на Endian'е с поддержкой аутентификации по X.509 certificate, а также как избежать распространенной ошибки: TLS_ERROR: BIO read tls_read_plaintext error: error:140890B2:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned, т.е.:
Предположим что мы создали все ключи и сертификаты, также экспортировали серверный ключ и сертификат (server.key, server.crt), а также ca.crt в PKCS12 и получили server.p12, который успешно загрузили в наш EFW. Под ОС Windows это можно сделать с помощью bat'ника build-key-pkcs12.bat в комплекте Easy RSA Tools. После чего создаем клиентские ключи, конфиги и убеждаемся в том, что клиент не коннектится к EFW из-за пресловутой TLS Error: TLS handshake failed. А всё почему . в конфигах сервера (посмотреть можно /etc/openvpn/openvpn.conf) стоит опция ns-cert-type client. Т.е. клиентский сертификат должен обязательно в поле Тип сертификата Netscape содержать - "SSL-проверка подлинности клиента (80)". Обратите внимание на картинку:
Как же сгенерировать клиентский сертификат таким образом, чтобы он обеспечивал SLL проверку подлинности клиента? Нет ничего проще. Вносим изменения в наш openssl.cnf, дописывая туда строки:
После чего, в bat'нике для генерации клиентского серфтификата и ключа build-key.bat при генерации сертификата дописываем ключ -extensions client, т.е. вот так:
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -extensions client -config %KEY_CONFIG%
There are numerous open source firewall, router and network server projects. In this two-part tutorial we will discuss the free community version of Endian. It’s a Linux distribution that can turn any system into a full-featured network and Internet security appliance.
There are numerous open source server, firewall and router and projects, but few, like Endian, are also Linux distros that can turn any system into both a full-featured network and Internet security appliance. We step through a basic Endian config, including setting up the Internet connection and creating a local network, and then setting up the OpenVPN server.
First, we will perform the basic configuration of Endian. This includes setting up the Internet connection and creating a local network with DHCP enabled. Then, we will set up the OpenVPN server. (Note that this tutorial is based on Endian Firewall Community version 2.4, released May 29 2010.)
You’ll see how to configure Road Warrior VPN connections, so you can securely access your network from remote locations or protect local traffic on public Internet ports or Wi-Fi hotspots. You’ll also see how to configure gateway-to-gateway VPN connections, so you can securely connect multiple offices together via the Internet.
Then, you can look into the other features, such as the stateful packet inspection firewall, application-level proxies with antivirus support, virus and spam-filtering for email, and content filtering of Web traffic.
Performing the Initial Configuration
Now you must find out which network interface is the default LAN port, so you can log in to the web-based front end to configure Endian. To get started, set a network interface on a PC to a static IP address within the range of the address you assigned to Endian. If you set Endian to 192.168.1.1 during the installation, you could set your PC to 192.168.1.2.
Now plug an Ethernet cable into the PC and plug the other end into a port on the Endian machine. Give it a moment to attempt a connection. On the PC, enter the IP address you assigned to Endian into a web browser. If the web-based front end appears (you’ll first see a warning about the SSL certificate), then you have the correct network interface. If nothing loads, try the next port on the Endian machine, and so on until you find it.
Once you find the default LAN port, ignore the SSL certificate warning, as Endian uses self-signed certificates. Next, you’ll see the welcome page of the initial configuration wizard. This wizard will help you set your language and time zone, read and accept the license, set the passwords, and configure the basic network settings.
During the network setup wizard, you’ll discover that Endian assigns colors to interfaces:
- Green – LAN
- Red – WAN/Internet
- Orange – DMZ
- Blue – Wi-Fi
Once you apply the configuration and the services have reloaded, you’ll be prompted to log in. Log in with the default username of “admin” and the password you created earlier. If somehow the password you created didn’t save (e.g., if you hit cancel rather than continue), you can use the default password of “endian.”
After you log in, one of the first things you’ll probably want to do is enable DHCP on the LAN or Wi-Fi interfaces. Click the Services link, select Enabled for the desired interfaces, and hit Save.
Then you can go back to the settings of your network adapter on your PC, erase the static IP details, and re-enable automatic (DHCP) addressing. The PC should then receive an IP address within the range of the IP you set earlier for that interface.
At this point, the basic functions are configured, and you can hook up the Endian machine in the production environment. Connect the Internet cable to the WAN interface. You can plug a switch into the LAN interface for additional ports.
Install and Configure Endian Firewall on VirtualBox
Once you are done setting up the virtual machine, click Start to start the installation. Once the virtual machine runs, you are prompted to choose the installation language.
Choose your language and press Enter. On the welcome screen, press Ok to proceed.
Next, Select Yes and press Enter to start partitioning the disk in preparation for installation of EFW.
Next, you are prompted to enable connection over serial cable. This is optional and thus it is disabled in this guide.
Next, you need to configure Endian Firewall GREEN interface IP. GREEN interface IP is the LAN interface IP for EFW. You can learn more about network zones on the network settings page. The default IP for the GREEN interface is 192.168.0.15/24. Be sure to change this based on your network.
Remember this is the internal network interface we assigned while setting up virtual machine.
Once you are done with network settings, press Enter to run post installation tasks and install EFW on VirtualBox.
Once the installation is done, press Enter to reboot the EFW virtual machine. When it boots up, it presents to the GRUB menu. You can press Enter to boot the default EFW OS.
Once EFW boot is complete, you should be able to see the screen presenting you with different menus as shown below.
You can select any option to perform a specific task as indicated. Proceed to the Next page to complete the installation and configuration of EFW.
Enabling the OpenVPN server
On the web-based front end, click the VPN link. Select the OpenVPN server enabled checkbox, as Figure 2 shows. If the Dynamic IP pool start address is the same as the Endian address, enter something different. Click Save and Restart to continue.
By default, the server is set to use pre-shared key (PSK) authentication, which is what we’re going to cover. This means clients use the usernames and passwords you create to log into the VPN server. You have the option of using certificate-based authentication, where you create and distribute certificate files for each client. For maximum security, implement both PSK and certificate authentication.
You can set the authentication and other server settings on the Advanced tab.
Continue on to Part 2 to learn how to set up and create OpenVPN client accounts.
Eric Geier is the Founder and CEO of NoWiresSecurity, which helps businesses easily protect their Wi-Fi with enterprise-level encryption by offering an outsourced RADIUS/802.1X authentication service. He is also the author of many networking and computing books, for brands such as For Dummies and Cisco Press.
Create New Virtual Machine
- 20GB storage disk
- 2GB RAM
- 2 CPU cores
- At least two network interface cards. This guide uses 4 interfaces (LAN, WAN, DMZ, WiFi). (Arrangement may vary for your case)
- First Interface: GREEN Zone (LAN) – Internal network- intnet
- Second Interface: RED Zone (WAN) – Bridged
- Third Interface: ORANGE Zone (DMZ) – Internal network- intnet1
- Fourth Interface: BLUE Zone (WiFi) – Internal network- intnet2
Once you have created a new virtual machine, mount the Endian Firewall ISO and boot the new virtual machine with it.
Installing the Endian Community Edition
First, prepare server (or PC) with the following system requirements:
- CPU: Intel x86 compatible (500MHz minimum, 1GHz recommended)
- RAM: 256MB minimum (512MB recommended)
- Disk: SCSI, SATA, SAS or IDE disk required (4GB minimum)
- CD-ROM: IDE, SCSI or USB CDROM drive required for installation
- Network Cards: At least two Ethernet cards are required, one for the WAN/Internet and one for the LAN.
Endian will automatically format the drive during the installation, so make sure all data is backed up before installing. During the initial installation, you must have a monitor and keyboard hooked up. However, once you have Endian installed and can access the web-based front end, you can go headless.
To get started, download the ISO CD image file and burn it to a disc.
To get started, pop in the Endian CD you burned and restart the machine. It should automatically boot into Endian and bring up the installation screens. You’ll select a language, it will portion your drive, and you’ll set the IP address of the Endian machine. Once successfully installed, remove the CD, and it will boot up. When you see the main Endian screen (as shown in Figure 1), which displays the IP address and boot menu, you can unplug the monitor and keyboard and continue with the next section.
Endian FW OpenVPN Client configuration & Freedom-IP service
Download Endian Firewall Community
Navigate to the Endian Firewall community downloads page and grab the latest installation ISO.
Endian FW OpenVPN Client configuration & Freedom-IP service
Post by parsifal_sk » Fri Apr 08, 2016 9:34 am
If I configure my windows client, all works well, so I assume the certificate is ok.
I have some problems only using Endian Firewall (v. 3.0).
These are my last tries logs:Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 OpenVPN 2.1.4 i586-pc-linux [SSL] [LZO2] [EPOLL] built on Jan 28 2011
Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 WARNING: No server certificate verification method has been enabled. See howto for more info.
Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 NOTE: --script-security method='system' is deprecated due to the fact that passed parameters will be subject to shell expansion
Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 LZO compression initialized
Apr 6 18:49:20 endian freedom-ip[4469]: Wed Apr 6 18:49:20 2016 Attempting to establish TCP connection with 37.59.88.92:443 [nonblock]
Apr 6 18:49:21 endian freedom-ip[4469]: Wed Apr 6 18:49:21 2016 TCP connection established with 37.59.88.92:443
Apr 6 18:49:21 endian freedom-ip[4469]: Wed Apr 6 18:49:21 2016 TCPv4_CLIENT link local: [undef]
Apr 6 18:49:21 endian freedom-ip[4469]: Wed Apr 6 18:49:21 2016 TCPv4_CLIENT link remote: 37.59.88.92:443
Apr 6 18:49:21 endian freedom-ip[4469]: Wed Apr 6 18:49:21 2016 Connection reset, restartingApr 6 18:49:21 endian freedom-ip[4469]: Wed Apr 6 18:49:21 2016 SIGUSR1[soft,connection-reset] received, process restarting
Apr 6 18:49:31 endian freedom-ip[4469]: Wed Apr 6 18:49:31 2016 WARNING: No server certificate verification method has been enabled. See howto for more info.
Apr 6 18:49:31 endian freedom-ip[4469]: Wed Apr 6 18:49:31 2016 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Apr 6 18:49:31 endian freedom-ip[4469]: Wed Apr 6 18:49:31 2016 NOTE: --script-security method='system' is deprecated due to the fact that passed parameters will be subject to shell expansion
Apr 6 18:49:31 endian freedom-ip[4469]: Wed Apr 6 18:49:31 2016 LZO compression initialized
Apr 6 18:49:32 endian freedom-ip[4469]: Wed Apr 6 18:49:32 2016 Attempting to establish TCP connection with 37.59.88.92:443 [nonblock]
Apr 6 18:49:33 endian freedom-ip[4469]: Wed Apr 6 18:49:33 2016 TCP connection established with 37.59.88.92:443
Apr 6 18:49:33 endian freedom-ip[4469]: Wed Apr 6 18:49:33 2016 TCPv4_CLIENT link local: [undef]
Apr 6 18:49:33 endian freedom-ip[4469]: Wed Apr 6 18:49:33 2016 TCPv4_CLIENT link remote: 37.59.88.92:443
Apr 6 18:49:33 endian freedom-ip[4469]: Wed Apr 6 18:49:33 2016 Connection reset, restartingIf I well understood, there is a problem with the certificate validation, but I don't know how to solve it.
Any suggestion?
Thanks in advance.Читайте также: