Архив рубрики: Публикации

Интернет премиум-класса: как подключить и настроить роутер Asus

Долгое время компания ASUS держалась в стороне от рынка сетевого оборудования, выпуская лишь устройства low-end сегмента, простенькие белые коробки с не запоминающимся дизайном и сырым программным обеспечением. Ещё каких-то пять лет назад интернет-провайдеры Воронежа отказывались подключать клиента, если он купил себе маршрутизатор ASUS. И вдруг все изменилось, как по взмаху волшебной палочки. Осознав перспективность рынка маршрутизаторов, за короткий срок компания сумела разработать и запустить в серийное производство несколько десятков моделей роутеров — от бюджетных решений, до высокопроизводительных моделей премиум-сегмента.

Великолепный футуристический дизайн, богатая аппаратная начинка, программное обеспечение на основе OpenSource проекта OpenWRT, но с фирменными фишками и великолепным веб-интерфейсом — все это вывело фирму ASUS в лидеры рынка сетевого оборудования для дома и офиса.

Читать

Как установить Python 3.6.4 на Debian 9

Python является интерактивным и объектно-ориентированным языком сценариев. Это один из самых популярных языков программирования. Python является язык программирования общего назначения. Он использует английские ключевые слова вместо знаки препинания, а также имеет меньше синтаксических конструкций, чем в других языках программирования и позволяет разработчикам использовать различные стили программирования для создания своих программ, и писать код так, как будто на человеческом языке. Установка Python 3.6.4 на Debian VPS, является легкой задачей, просто следуйте внимательно инструкциям ниже и вы должны установить  Python 3.6.4 в течение нескольких минут на Debian 9.

Обновление системы

Как обычно, обновление всех системных пакетов, прежде чем продолжить работу на сервере:

# sudo apt-get update && sudo apt-get upgrade

Установка Python 3.6.4 из исходных текстов

Теперь мы будем строить и установить Python 3.6.4 из исходников, это самый безопасный и рекомендуемый способ, который не добавляет каких-либо хранилищ, которые могли бы установить конфликтующие пакеты на сервере Debian 9.

Начните с установки необходимых инструментов для сборки Python 3.6.4:

# sudo apt-get install -y make build-essential libssl-dev zlib1g-dev

# sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm

# sudo apt-get install -y libncurses5-dev  libncursesw5-dev xz-utils tk-dev

 

Скачайте исходный файл Python 3.6.4 с помощью «wget»:

# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

 

Распакуйте исходный файл Python 3.6.4:

# tar xvf Python-3.6.4.tgz

 

Перейдите в каталог Python-3.6.4 и запустите «./configure», чтобы подготовить сборку:

# cd Python-3.6.4

# ./configure --enable-optimizations

 

Затем выполните следующую команду, чтобы построить Python 3.6.4:

# make -j8

 

А затем запустите эту команду, чтобы установить Python 3.6.4:

# sudo make altinstall

 

Теперь вы можете открыть интерпретатор Python 3.6.4, выполнив следующую команду:

# python3.6

Установка Python 3.6.4 из репозитория ‘testing’ в Debian

Этот способ установки Python 3.6.4 не рекомендуется, поскольку он может устанавливать/обновлять пакеты из репозитория  ‘testing’ в  Debian, которые несовместимы с вашей текущей установкой Debian 9. Если вы хотите установить Python 3.6.4 с помощью хранилища ‘testing’  в Debian, попробуйте это на тестовой машине первым, чтобы увидеть, что любой из пакетов не установиться или если есть какие-либо конфликты после установки пакетов, необходимых для Python 3.6 +0,4.

Начните с редактирования файла «/etc/apt/sources.list» вашим любимым редактором (мы будем использовать nano) и добавьте строку ниже в нижней части файла:

# sudo nano /etc/apt/sources.list



deb http://ftp.de.debian.org/debian testing main

 

Затем выполните следующую команду, чтобы сделать хранилище ‘stable’ по умолчанию на сервере:

# echo 'APT::Default-Release "stable";' | sudo tee -a /etc/apt/apt.conf.d/00local

 

Теперь обновите список пакетов:

# sudo apt-get update

 

И установите Python 3.6.4 от репозитория  ‘testing’ в Debian с помощью следующей команды:

# sudo apt-get -t testing install python3.6

 

Если все прошло хорошо, выполните следующую команду, чтобы открыть интерпретатор Python 3.6.4:

# python3.6

 

Вот, теперь вы должны иметь установленный Python 3.6.4 на вашем сервере.

 



2018-03-27T16:20:37
Установка ПО на Debian

Руководство для начинающих: Как отцентрировать видео в WordPress

Вы хотите отцентрировать видео в WordPress? По умолчанию, если ширина вашего видео меньше вашей области статьи, то WordPress автоматически выравнивает ее влево, оставляя дополнительное пустое пространство на правой стороне. В этой статье мы покажем вам, как легко отцентрировать видео в WordPress.

Зачем выравнивать по центру видео в WordPress?

По умолчанию, когда вы встраиваете видео в WordPress, оно автоматически выравнивается по левому краю. Это потому, что видео контент не встроен в содержаниие, поэтому WordPress не может угадать, как вы хотели бы отобразить его.

В качестве лучшей практики, она автоматически выравнивает ее влево. Оставив его до вас, чтобы настроить выравнивание, если это необходимо.

Мы не рекомендуем загружать видео непосредственно на WordPress, но то же самое произойдет с загруженными видео, если его ширина меньше, чем области контента.

Это, как говорится, давайте посмотрим, как вы можете легко центрировать видео в WordPress или сделать его шире, так чтобы оно хорошо выглядело в содержании.

Как выровнять по центру видео в WordPress

Если вы хотите, чтобы ваше видео заполняло ширину области контента, то лучший способ сделать это, добавив YouTube или Vimeo видео URL непосредственно в редакторе постов вместо того, чтобы использовать код.

Просто введя URL, WordPress автоматически попытается отобразить видео, которое соответствует вашей области содержимого.

Как отцентрировать видео в WordPress

Однако иногда по той или иной причине, возможно, придется использовать код. В этом случае вам нужно будет добавить простой HTML код вокруг встраиваемого видео.

Во- первых, вам необходимо переключиться в текстовый редактор на экране редактирования поста. После этого, вам нужно добавить следующий HTML — код вокруг вашего видео, вставив код:

<div style="text-align:center;">

 

/// здесь код вставки видео

 

</div>

 

Теперь вы можете сохранить изменения и просмотреть запись или страницу. Ваше видео будет аккуратно выровнено по центру области контента.

 



2018-03-26T19:03:26
Лучшие учебники по Wodpress

MikroTik Site to Site GRE Tunnel Configuration with IPsec

VPN (Virtual Private Network) is a technology that provides a secure tunnel across a public network. A private network user can send and receive data to any remote private network using VPN Tunnel as if his/her network device was directly connected to that private network.




MikroTik provides GRE (Generic Routing Encapsulation) tunnel that is used to create a site to site VPN tunnel. GRE tunneling protocol which can encapsulate a wide variety of protocols creating a virtual point-to-point link was originally developed by Cisco. GRE is a stateless tunnel like EoIP and IPIP. That means if the remote end of the tunnel goes down, all traffic that was routed over the tunnels will get blackholed. To solve this problem, RouterOS have added ‘keepalive’ feature for GRE tunnels. By default keepalive is set to 10 seconds and 10 retries.




GRE adds an outer header mentioning the entry point of the tunnel (SourceIP) and the exit point of the tunnel (DestinationIP) but the inner packet is kept unmodified.




ipip encapsulation
GRE Encapsulation




GRE tunnel only encapsulates IP packets but does not provide authentication and encryption. GRE tunnel with IPsec ensures IP packet encapsulation as well as authentication and encryption. IPsec usage makes your packets secure but it works slowly because of having extra authentication and encryption process. So, my opinion is that if data security is your concern, use GRE tunnel with IPsec but if data security is not so headache, use only MikroTik GRE tunnel because it works so faster.




The goal of this article is to design a GRE VPN tunnel with IPsec. So, in this article I will show how to create a GRE tunnel with IPsec to establish a secure site to site VPN tunnel between two Routers.




Network Diagram




To configure a site to site GRE VPN Tunnel (with IPsec) between two MikroTik Routers, I am following a network diagram like below image.




Site to Site GRE Tunnel with IPsec
Site to Site GRE Tunnel with IPsec




In this network, Office1 Router is connected to internet through ether1 interface having IP address 192.168.70.2/30. In your real network this IP address will be replaced with public IP address provided by your ISP. Office1 Router’s ether2 interface is connected to local network having IP network 10.10.11.0/24. After GRE tunnel configuration, an GRE tunnel interface will be created in Office 1 Router whose IP address will be assigned 172.22.22.1/30.




Similarly, Office 2 Router is connected to internet through ether1 interface having IP address 192.168.80.2/30. In your real network this IP address will also be replaced with public IP address. Office 2 Router’s ether2 interface is connected to local network having IP network 10.10.12.0/24. After GRE tunnel configuration an GRE tunnel interface will also be created in Office 2 Router whose IP address will be assigned 172.22.22.2/30.




We will configure a site to site GRE Tunnel between these two MikroTik Routers so that local network of these routers can communicate with each other through this VPN tunnel across public network.




Core Devices and IP Information




To configure a site to site GRE VPN between two Routers, I am using two MikroTik RouterOS v6.38.1. IP information that I am using for this network configuration are given below.




  • Office 1 Router WAN IP: 192.168.70.2/30, LAN IP Block 10.10.11.0/24 and Tunnel interface IP 172.22.22.1/30
  • Office 2 Router WAN IP: 192.168.80.2/30, LAN IP Block 10.10.12.0/24 and Tunnel interface IP 172.22.22.2/30




This IP information is just for my RND purpose. Change this information according to your network requirements.




Site to Site EoIP Tunnel Configuration with IPsec




We will now start our site to site GRE VPN configuration according to the above network diagram. Complete GRE configuration can be divided into four parts.




  • MikroTik RouterOS basic configuration
  • GRE tunnel configuration with IPsec
  • Assigning IP address on tunnel interface
  • Static route configuration




Part 1: MikroTik RouterOS Basic Configuration




Basic RouterOS configuration includes assigning WAN IP, LAN IP, DNS IP and Route, NAT configuration. According to our network diagram, we will now complete these topics in our two MikroTik RouterOS (Office 1 Router and Office 2 Router).




Office 1 Router Basic Configuration




The following steps will guide you how to perform basic configuration in your Office 1 RouterOS.




  • Login to Office 1 RouterOS using winbox and go to IP > Addresses. In Address List window, click on PLUS SIGN (+). In New Address window, put WAN IP address (192.168.70.2/30) in Address input field and choose WAN interface (ether1) from Interface dropdown menu and click on Apply and OK button. Click on PLUS SIGN again and put LAN IP (10.10.11.1/24) in Address input field and choose LAN interface (ether2) from Interface dropdown menu and click on Apply and OK button.
  • Go to IP > DNS and put DNS servers IP (8.8.8.8 or 8.8.4.4) in Servers input field and click on Apply and OK button.
  • Go to IP > Firewall and click on NAT tab and then click on PLUS SIGN (+). Under General tab, choose srcnat from Chain dropdown menu and click on Action tab and then choose masquerade from Action dropdown menu. Click on Apply and OK button.
  • Go to IP > Routes and click on PLUS SIGN (+). In New Route window, click on Gateway input field and put WAN Gateway address (192.168.70.1) in Gateway input field and click on Apply and OK button.




Basic RouterOS configuration has been completed in Office 1 Router. Now we will do similar steps in Office 2 RouterOS.






Office 2 Router Basic Configuration




The following steps will guide you how to perform basic configuration in your Office 2 RouterOS.




  • Login to Office 2 RouterOS using winbox and go to IP > Addresses. In Address List window, click on PLUS SIGN (+). In New Address window, put WAN IP address (192.168.80.2/30) in Address input field and choose WAN interface (ether1) from Interface dropdown menu and click on Apply and OK button. Click on PLUS SIGN again and put LAN IP (10.10.12.1/24) in Address input field and choose LAN interface (ether2) from Interface dropdown menu and click on Apply and OK button.
  • Go to IP > DNS and put DNS servers IP (8.8.8.8 or 8.8.4.4) in Servers input field and click on Apply and OK button.
  • Go to IP > Firewall and click on NAT tab and then click on PLUS SIGN (+). Under General tab, choose srcnat from Chain dropdown menu and click on Action tab and then choose masquerade from Action dropdown menu. Click on Apply and OK button.
  • Go to IP > Routes and click on PLUS SIGN (+). In New Route window, click on Gateway input field and put WAN Gateway address (192.168.80.1) in Gateway input field and click on Apply and OK button.




Basic RouterOS configuration has been completed in Office 2 Router. Now we are going to start EoIP tunnel configuration.




Part 2: GRE Tunnel Configuration with IPsec




After MikroTik Router basic configuration, we will now configure GRE tunnel with IPsec in both MikroTik RouterOS. In GRE tunnel configuration, we will specify local and remote IP address as well as shared secret for IPsec.




GRE Tunnel Configuration in Office 1 Router




The following steps will show how to configure GRE tunnel in your Office 1 Router.




  • Click on Interfaces menu item from Winbox and click on GRE Tunnel tab and then click on PLUS SIGN (+). New Interface window will appear.
  • Put a meaningful GRE tunnel interface name (gre-tunnel-r1) in Name input field.
  • Put Office 1 Router’s WAN IP address (192.168.70.2) in Local Address input field.
  • Put Office 2 Router’s WAN IP address (192.168.80.2) in Remote Address input field.
  • Put IPsec shared secret in IPsec Secret input field if your router supports IPsec and you wish to enable IPsec authentication and encryption. You should remember that this IPsec Secret must be same in both routers.
  • Also uncheck Allow Fast Path checkbox if it is checked and you want to enable IPsec.
  • Click Apply and OK button.
  • You will find a new GRE tunnel interface followed by your given name (gre-tunnel-r1) has been created in Interface List window.




GRE tunnel configuration in Office 1 Router has been completed. Now we will do the similar steps in our Office 2 Router to create GRE tunnel interface.




GRE Tunnel Configuration in Office 2 Router




The following steps will show how to configure GRE tunnel in your Office 2 Router.




  • Click on Interfaces menu item from Winbox and click on GRE Tunnel tab and then click on PLUS SIGN (+). New Interface window will appear.
  • Put a meaningful GRE tunnel interface name (gre-tunnel-r2) in Name input field.
  • Put Office 2 Router’s WAN IP address (192.168.80.2) in Local Address input field.
  • Put Office 1 Routers WAN IP address (192.168.70.2) in Remote Address input field.
  • Put IPsec shared secret in IPsec Secret input field if your router supports IPsec and you wish to enable IPsec authentication and encryption. You should remember that this IPsec Secret must be same in both routers.
  • Also uncheck Allow Fast Path checkbox if it is checked and you want to enable IPsec.
  • Click Apply and OK button.
  • You will find a new GRE tunnel interface followed by your given name (gre-tunnel-r2) has been created in Interface List window.




GRE tunnel configuration in Office 2 Router has been completed. Now we will assign IP address in our newly created GRE tunnel interface in our both RouterOS so that both router can communicate with each other through this VPN tunnel interface.




Part 3: Assigning IP Address in GRE Tunnel Interface




After GRE tunnel configuration, a new GRE tunnel interface has been created in both routers. So, if we assign same block IP in both interfaces, the both router will be able to communicate with each other through this EoIP tunnel. In this part, we will now assign IP address in our newly created tunnel interface.




Assigning IP Address on Office 1 Router’s GRE Tunnel Interface




The following steps will show how to assign IP address on Office 1 Router’s tunnel interface.




  • Go to IP > Address menu item and click on PLUS SIGN (+).
  • Put a new private IP Block IP (172.22.22.1/30) in Address input field.
  • Choose newly created tunnel interface (eoip-tunnel-r1) from Interface drop down menu.
  • Click Apply and OK button.




Assigning IP address on Office 1 Router’s tunnel interface has been completed. Similarly, we will now assign IP address on Office 2 Router’s tunnel interface.




Assigning IP Address on Office 2 Router’s GRE Tunnel Interface




The following steps will show how to assign IP address in Office 2 Router’s tunnel interface.




  • Go to IP > Address menu item and click on PLUS SIGN (+).
  • Put a new private IP Block IP (172.22.22.2/30) in Address input field.
  • Choose newly created tunnel interface (eoip-tunnel-r2) from Interface drop down menu.
  • Click Apply and OK button.






Assigning IP address on Office 2 Router’s tunnel interface has been completed. In this stage both routers are now able to communicate with each other. But both routers’ LAN cannot communicate with each other without static routing configuration. So, in the next part we will configure static routing in our both Office Router.




Part 4: Static Route Configuration




We will now configure static route in our both Office Router so that each router’s LAN can communicate with each other through GRE tunnel.




Static Route Configuration in Office 1 Router




The following steps will show how to configure static route in Office 1 Router.




  • Go to IP > Routes and click on PLUS SIGN (+). New Route window will appear.
  • In New Route window, put destination IP Block (10.10.12.0/24) in Dst. Address input field.
  • Put the Gateway address (172.22.22.2) in Gateway input field.
  • Click Apply and OK button.




Static route configuration in Office 1 Router has been completed. Now we will configure static route in Office 2 Router.




Static Route Configuration in Office 2 Router




The following steps will show how to configure static route in Office 2 Router.




  • Go to IP > Routes and click on PLUS SIGN (+). New Route window will appear.
  • In New Route window, put destination IP Block (10.10.11.0/24) in Dst. Address input field.
  • Put the Gateway address (172.22.22.1) in Gateway input field.
  • Click Apply and OK button.




Static route configuration in Office 2 Router has been completed. Now both router as well as its LAN can communicate with each other through GRE tunnel across public network.




To check your configuration, do a ping request from any router or any local network machine to other local network machine. If everything is OK, your ping request will be success.




If you face any problem to follow above steps properly, watch my video about GRE VPN tunnel configuration with IPsec. I hope it will reduce your any confusion.