• Home
  • WIKI
  • Raspberry PI
  • Home Assistant
  • Mass Effect Wiki
  • Openwrt
IPTV

Openwrt

Details
Written by: Super Utilizador
Category: Não categorizados
Published: 21 September 2024
Hits: 153

To create a well-structured network with the devices you have and meet your goals (like OpenVPN on specific devices), we can break this down into a few steps. The best network configuration will depend on your usage requirements and the flexibility you need for future changes.

Step 1: Choosing the Best Network Topolog

y

You have two main options:

Option 1: All devices connected to the operator router (via cable)

  • Advantages:
    • Simplified setup: Each router gets its own IP from the operator router.
    • No single point of failure: If one router has issues, the others remain unaffected.
    • Independent network management for each router.
  • Disadvantages:
    • Multiple subnets might exist, which can make communication between devices on different routers tricky.
    • You would need to configure OpenVPN separately on the Xiaomi AC2100 to apply only to specific devices.

Option 2: ASUS RT-AC68U in bridge mode (connected to the operator router), with Xiaomi and TP-Link Deco M5s connected to ASUS

  • Advantages:
    • Single network (managed by ASUS), making device-to-device communication seamless.
    • Simplified routing and control over all network traffic (you can centralize policies like firewall rules, VPN settings).
    • Easier to implement OpenVPN rules because all the devices will be under the ASUS router’s network.
  • Disadvantages:
    • ASUS becomes a single point of failure for all the devices behind it.
    • More complex configuration, as you will need to set up the ASUS router in bridge mode (to avoid double NAT) and configure proper DHCP or static routing.

Recommendation:
Go with Option 2 (ASUS in bridge mode). This provides more flexibility, especially when implementing specific configurations like OpenVPN and managing traffic based on IP addresses.

Step 2: Setting Up ASUS in Bridge Mode

  1. Disable the DHCP server on the ASUS router to avoid conflicts with the operator router.
    • Access the ASUS router via SSH or web interface.
    • Navigate to the Network > Interfaces > LAN.
    • Under DHCP Server settings, disable the DHCP.
  2. Set the ASUS router to bridge mode:
    • Go to Network > Interfaces and change the WAN interface to bridged mode.
    • Set the LAN interface to provide IPs from the operator router (or leave it static if you prefer).
  3. Connect the Xiaomi and TP-Link Deco M5 routers to the ASUS via Ethernet.
    • These devices will automatically receive an IP address from the ASUS router.

Step 3: OpenVPN on the Xiaomi AC2100 (to specific devices)

Since you want the OpenVPN to work only for devices connected via cable or to specific IP addresses, you can achieve this by creating firewall rules and routing policies.

  1. Set up OpenVPN on the Xiaomi AC2100:
    • Follow the OpenVPN guide on OpenWRT to configure OpenVPN. Ensure that the VPN service starts correctly.
    • You will need the OpenVPN package installed:bashopkg update opkg install openvpn-openssl luci-app-openvpn
    • Copiar código
    • Configure the openvpn.conf file as needed (for example, with your VPN provider's config or your own).
  2. Restrict VPN to wired devices:
    • Identify the IP addresses or MAC addresses of devices connected via Ethernet.
    • Use PBR (Policy-Based Routing) to route only certain devices through the VPN.
    Install the luci-app-vpn-policy-routing package:After installation:
    • Go to Services > VPN Policy Routing in the LuCI web interface.
    • Create rules to route traffic from specific IP addresses or MAC addresses through the VPN interface.
  3. bashopkg install luci-app-vpn-policy-routing
  4. Copiar código
  5. Alternative: VPN for a Specific Subnet (e.g., Wired Devices Only):
    • You can use VLANs to segment wired and wireless traffic.
    • Configure VLANs on Xiaomi to have separate VLANs for wired and wireless clients. Apply the VPN only to the VLAN for wired devices.

Step 4: Configure TP-Link Deco M5 Units

  • Set both TP-Link Deco M5 units in AP (Access Point) mode:
    • You can disable their routing functionality since they will be behind the ASUS router.
    • In AP mode, they will pass the traffic to the ASUS router without performing NAT.
    • Go to Network > Interfaces and set them up as DHCP clients (or assign static IPs if desired).

Step 5: Static IP Assignment (Optional but Recommended)

To make things easier to maintain:

  • Assign static IPs to devices that you want to manage through the OpenVPN (or route differently). You can do this via the DHCP settings on the ASUS router:
    • Go to Network > DHCP and DNS > Static Leases.
    • Add the MAC addresses of devices you want to assign static IPs to.

Final Notes:

  • VPN Configuration: To ensure VPN works on specific devices or segments, the Xiaomi AC2100 should handle VPN routing rules. If devices are segmented into subnets or VLANs, the Xiaomi AC2100 can apply VPN policies more cleanly.
  • ASUS Router Stability: Since the ASUS RT-AC68U will handle most of the traffic, ensure it's stable and has enough processing power to handle VPN passthrough if needed.
  • Monitoring: Use tools like luci-app-statistics or iftop to monitor traffic and ensure your configuration is working as expected.


 

To set up the network with the ASUS RT-AC68U as the main router (in bridged mode) and other devices (Xiaomi AC2100, TP-Link Deco M5s) connected to the ASUS, follow this step-by-step plan. I will guide you on what configuration files you will need, as well as which router to configure first and how to proceed.

Step-by-Step Plan:

1. Configure the ASUS RT-AC68U (Main Router)

The ASUS will act as the main router, distributing IP addresses and routing traffic for the network. You’ll set this up first because the other devices (Xiaomi and TP-Link routers) will depend on this setup.

1.1 Disable DHCP on ASUS

This will prevent double NAT issues and allow the operator router to handle DHCP and IP assignment.

  1. SSH into the ASUS RT-AC68U:
  2. bashssh This email address is being protected from spambots. You need JavaScript enabled to view it..1.2
  3. Copiar código
  4. Edit the /etc/config/dhcp file to disable the DHCP server on the LAN interface. You can use Nano to edit the file:
  5. bashnano /etc/config/dhcp
  6. Copiar código
  7. Look for the following section:Modify this section to disable DHCP:
  8. bashconfig dhcp 'lan' option interface 'lan' option ignore '1'
  9. Copiar código
  10. bashconfig dhcp 'lan' option interface 'lan' option start '100' option limit '150' option leasetime '12h'
  11. Copiar código
  12. Save and close the file with Ctrl + X, then press Y and Enter.
  13. Restart the networking service to apply changes:
  14. bash/etc/init.d/network restart
  15. Copiar código
1.2 Set the WAN Interface to Bridged Mode

In bridged mode, the ASUS RT-AC68U will pass traffic from the operator router, allowing the operator router to handle routing for internet traffic.

  1. Edit the /etc/config/network file:bashnano /etc/config/network
  2. Copiar código
  3. Find the WAN interface configuration and modify it like this:bashconfig interface 'wan' option ifname 'eth0.2' option proto 'dhcp' option type 'bridge'
  4. Copiar código
  5. Also, configure the LAN interface for the ASUS router. If you want the ASUS to have a static IP (recommended for management):bashconfig interface 'lan' option ifname 'eth0.1' option proto 'static' option ipaddr '192.168.1.2' option netmask '255.255.255.0' option gateway '192.168.1.1' # Operator router's IP option dns '192.168.1.1' # Operator router as DNS server
  6. Copiar código
  7. Save and close the file, then restart the network service:bash/etc/init.d/network restart
  8. Copiar código

Now, the ASUS RT-AC68U will pass all traffic through to the operator router, and the operator router will handle DHCP, DNS, and routing.

1.3 Connect Other Devices to ASUS

Once the ASUS RT-AC68U is in bridge mode, connect the other devices (Xiaomi and TP-Link Deco M5s) via Ethernet cables to the ASUS LAN ports. These devices will receive IP addresses from the operator router.

2. Configure the Xiaomi AC2100 (VPN Router)

The Xiaomi AC2100 will handle OpenVPN for specific devices. You will need to set up OpenVPN and configure Policy-Based Routing (PBR) to apply VPN only to devices connected via cable or with specific IPs.

2.1 Set Static IP for Xiaomi Router

Set a static IP for the Xiaomi AC2100 so you can easily manage it. This can be done from the ASUS router’s DHCP settings or via SSH on the Xiaomi AC2100 itself.

  1. SSH into the Xiaomi router:bashssh This email address is being protected from spambots. You need JavaScript enabled to view it..1.3
  2. Copiar código
  3. Edit the /etc/config/network file:bashnano /etc/config/network
  4. Copiar código
  5. Set a static IP for the Xiaomi router:bashconfig interface 'lan' option ifname 'eth0' option proto 'static' option ipaddr '192.168.1.3' option netmask '255.255.255.0' option gateway '192.168.1.2' # ASUS Router's IP option dns '192.168.1.2'
  6. Copiar código
  7. Save and close the file, then restart the network service:bash/etc/init.d/network restart
  8. Copiar código
2.2 Install and Configure OpenVPN
  1. Install the OpenVPN package and web interface on the Xiaomi router:bashopkg update opkg install openvpn-openssl luci-app-openvpn
  2. Copiar código
  3. Upload your OpenVPN .ovpn configuration file to /etc/openvpn/ on the Xiaomi router, then edit the OpenVPN config:bashnano /etc/openvpn/myvpn.conf
  4. Copiar código
  5. Set up the OpenVPN configuration as needed for your VPN provider. Example:bashclient dev tun proto udp remote vpn-server.example.com 1194 resolv-retry infinite nobind persist-key persist-tun ca /etc/openvpn/ca.crt cert /etc/openvpn/client.crt key /etc/openvpn/client.key remote-cert-tls server cipher AES-256-CBC comp-lzo verb 3
  6. Copiar código
  7. Enable the OpenVPN service to start at boot:bash/etc/init.d/openvpn enable /etc/init.d/openvpn start
  8. Copiar código
2.3 Set Up Policy-Based Routing (PBR)

You only want the VPN to affect specific devices. We’ll use Policy-Based Routing to achieve this.

  1. Install the VPN Policy Routing package:bashopkg install luci-app-vpn-policy-routing
  2. Copiar código
  3. Configure PBR in the LuCI interface:
    • Navigate to Services > VPN Policy Routing.
    • Add rules based on IP addresses or MAC addresses. For example:
      • Devices with specific IPs (connected via cable) will use the VPN.
      • Devices connected via Wi-Fi will bypass the VPN.

3. Configure the TP-Link Deco M5 Units

These units will act as access points. You need to configure them in AP mode so that they do not perform NAT or routing, and only provide wireless access.

  1. SSH into each TP-Link Deco M5 unit:
  2. bashssh root@<DecoM5_IP>;
  3. Copiar código
  4. Disable DHCP on the Deco M5s:Set option ignore '1' for the LAN interface to disable DHCP.
  5. bashnano /etc/config/dhcp
  6. Copiar código
  7. Set up static IPs for each Deco unit (optional but recommended):Configure static IPs similar to the Xiaomi router.
  8. bashnano /etc/config/network
  9. Copiar código
  10. Set the Deco units in Access Point (AP) mode from the LuCI web interface or by disabling routing functionality through OpenWRT settings.

Step-by-Step Summary:

  1. ASUS RT-AC68U: Configure bridge mode and disable DHCP.
  2. Xiaomi AC2100: Set up OpenVPN and Policy-Based Routing to apply VPN to specific devices or subnets.
  3. TP-Link Deco M5s: Configure in Access Point mode and disable DHCP.

Let me know if you'd like any specific configuration files or if you encounter issues during setup!

 

 

 

 

 

Utilizar Raspberry Pi como Router cabeado

Details
Written by: Super Utilizador
Category: Não categorizados
Published: 18 April 2020
Hits: 413

Utilizar Raspberry Pi como Router cabeado

DNS Dinâmico com ddclient no Raspberry Pi

Details
Written by: Super Utilizador
Category: Não categorizados
Published: 18 April 2020
Hits: 434

DNS Dinâmico com ddclient no Raspberry Pi

POLÍTICA DE PRIVACIDADE

Details
Written by: Super Utilizador
Category: Não categorizados
Published: 02 February 2020
Hits: 204

Caso não concorde com a mesma não deverá usar o presente Website.
A presente Política de Cookies e Política de Privacidade enuncia as formas de recolha e utilização dos dados pessoais, assim como as medidas de salvaguarda e segurança adotadas no tratamento dos mesmos.

PTgames.pt reconhece a importância da privacidade. Nunca venderemos a sua informação para terceiros, sejam eles particulares ou empresas.

O website ptgames.pt é propriedade equipa ptgames.pt

 

Utilização de Cookies

PTgames.pt utiliza cookies que ajudam a oferecer-lhe um melhor serviço e experiência como utilizador do nosso site. Ao navegar no nosso site concorda com a utilização de cookies.

 

Política de Cookies

Para garantir que o nosso site apresenta uma boa experiência de navegação para os visitantes e disponibilizar um serviço mais personalizado, o nosso servidor utiliza cookies (pequenos ficheiros informativos) para recolher e guardar informação. Caso pretenda, poderá desativar esta configuração no seu navegador, com prejuízo de limitar acesso a determinadas áreas do site ou de receber informação personalizada.

A utilização de cookies é uma prática corrente na generalidade dos sites com o objetivo de poupar tempo ao utilizador e facilitar a navegação. PTgames.pt poderá utilizar cookies com a finalidade de recolher informação durante a sua visita ao site, tais como as zonas que visita e as atividades em que participa. Estes ficheiros são usados para evitar que o visitante tenha de introduzir repetidamente a sua informação pessoal, facilitar a navegação e a personalização do serviço. Os cookies poderão ser utilizados para ajudar nas suas utilizações futuras na aplicação. Uma vez que o computador consegue identificar a informação pessoal que já foi disponibilizada, não lhe será pedida novamente informação já anteriormente disponibilizada. O utilizador pode aceitar ou eliminar os cookies. A maioria dos navegadores ou aplicações de navegação na Internet aceita cookies automaticamente. Caso o utilizador não pretenda utilizar cookies deverá alterar as definições do seu navegador relativamente à aceitação ou não de cookies.

 

Política de Privacidade

Recolha de Informação

Sempre que for necessário a recolha de informação pessoal, a utilização dessa mesma informação será efetuada no cumprimento dos termos da legislação aplicável, Regulamento (UE) 2016/679 do Parlamento Europeu e do Conselho, de 27 de abril de 2016, é garantido ao titular dos dados o direito de acesso, retificação, alteração, eliminação e portabilidade dos seus dados pessoais, mediante pedido escrito para a entidade responsável por correio eletrónico dirigido a This email address is being protected from spambots. You need JavaScript enabled to view it.. O titular dos dados pode, ainda, apresentar reclamação junto da CNPD ou de outra autoridade de controlo nacional.

Toda a informação recolhida é cedida de forma voluntária seja via website, formulários online, questionários, promoções de serviços e/ou passatempos. PTgames.pt recolhe dados pessoais, tais como nomes, moradas, e-mails, números de telefone, endereço IP, dados demográficos e sobre estilos de vida para os fins que adiante se encontram indicados. A entidade responsável pela recolha e tratamento dos dados pessoais é PTgames.pt.

 

Utilização da Informação Recolhida

PTgames.pt compromete-se a cumprir as normas de tratamento de dados pessoais em vigor em Portugal.

A informação obtida poderá ser utilizada por  PTgames.pt, para enviar informação sobre marketing ou ações comerciais desenvolvidas para o efeito.

Os dados recolhidos destinam-se exclusivamente a uso PTgames.pt, por forma a dar seguimento aos pedidos efetuados através desta página web, sendo garantida a privacidade e proteção dos dados dos utilizadores.

PTgames.pt pode ceder a informação pessoal do utilizador a outras empresas, quando necessitar de o fazer para lhe fornecer um produto ou serviço, sendo garantido que apenas é partilhada a informação mínima necessária para a satisfação do pedido.

 

Direito de Aceso, Retificação, Cancelamento e Oposição

Em conformidade com o Regulamento (UE) 2016/679 do Parlamento Europeu e do Conselho, de 27 de abril de 2016, qualquer pessoa pode solicitar o acesso aos respetivos dados pessoais, podendo tomar conhecimento do seu teor, bem como,
exigir a sua retificação, atualização ou solicitar a sua destruição, por pedido escrito dirigido ao Gerador para o endereço de email: This email address is being protected from spambots. You need JavaScript enabled to view it.

 

Segurança e Proteção de Dados

PTgames.pt compromete-se a adotar as medidas de segurança necessárias para garantir a salvaguarda dos dados pessoais dos utilizadores contra a sua eventual utilização abusiva ou contra o acesso não autorizado.

Não obstante e, não sendo a internet um meio de comunicação 100% seguro, PTgames.pt não poderá garantir a segurança de qualquer informação que divulgue online, nem se responsabilizar por perdas ou danos causados ao utilizador como consequência da perda de confidencialidade da informação.

 

Responsabilidade

Nesta página web os utilizadores poderão encontrar links que o reencaminham para outras páginas web fora do domínio dos servidores PTgames.pt que poderão eles próprios recolher dados ou solicitar informação pessoal. A presente Política de Privacidade não se aplica a sites terceiros, pelo que, deverá ler a Política de Privacidade dos sites terceiros que visitar, sendo que não nos responsabilizamos pelo conteúdo e informação presente nesses mesmos sites.

 

Concordância da Política de Privacidade

Entende-se que o utilizador aceita as condições desta política de privacidade ao introduzir os seus dados. O preenchimento dos formulários supõe o consentimento por parte do utilizador do tratamento automatizado e utilização dos dados de acordo com as condições de privacidade descritas neste documento.

 

Alterações à Política de Privacidade

PTgames.pt reserva-se ao direito de, a qualquer momento, atualizar ou rever a presente Política de Privacidade a fim de a ajustar a eventuais alterações legislativas e/ou outros condicionalismos. Qualquer alteração efetuada será publicada neste espaço, pelo que o utilizador deverá visitar frequentemente esta área no sentido de se manter informado sobre a Política de Privacidade em vigor.

 

Weblate

Details
Written by: Super Utilizador
Category: Não categorizados
Published: 01 February 2020
Hits: 438

Install Docker Engine - Community

Install using the repository

  • Update the apt package index:

    $ sudo apt-get update
    
  • Install packages to allow apt to use a repository over HTTPS:

    $ sudo apt-get install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
        software-properties-common

 In the command-line you can enable it by

sudo add-apt-repository universe

Then you will be able to install it by

sudo apt install docker-compose

Installing Python via PPA

If you quickly want to get the latest version of Python installed on Ubuntu and get future updates automatically, then you can install it from the below third-party PPA repository…

To do that, run the commands below to add the PPA.

First install Ubuntu software properties package if it’s not already installed on your system..

sudo apt update
sudo apt install software-properties-common

After that run the commands to add the PPA..

sudo add-apt-repository ppa:deadsnakes/ppa

Finally, run the commands below to install Python 3.7

sudo apt update
sudo apt install python3.7
 

 

Installation

The following examples assume you have a working Docker environment, with docker-compose installed. Please check the Docker documentation for instructions.

  1. Install docker-compose: (if not installed yet)

    sudo apt-get install docker-compose
    
  2. Clone the weblate-docker repo:

    git clone https://github.com/WeblateOrg/docker-compose.git weblate-docker
    cd weblate-docker
    
  3. Create a docker-compose.override.yml file with your settings. See Docker environment variables for full list of environment variables.

    version: '3'
    services:
      weblate:
        ports:
          - 80:8080
        environment:
          WEBLATE_EMAIL_HOST: smtp.example.com
          WEBLATE_EMAIL_HOST_USER: user
          WEBLATE_EMAIL_HOST_PASSWORD: pass
          WEBLATE_SERVER_EMAIL: This email address is being protected from spambots. You need JavaScript enabled to view it.
          WEBLATE_DEFAULT_FROM_EMAIL: This email address is being protected from spambots. You need JavaScript enabled to view it.
          WEBLATE_ALLOWED_HOSTS: weblate.example.com,localhost
          WEBLATE_ADMIN_PASSWORD: password for the admin user
          WEBLATE_ADMIN_EMAIL: This email address is being protected from spambots. You need JavaScript enabled to view it.
    

    Note

    If WEBLATE_ADMIN_PASSWORD is not set, the admin user is created with a random password shown on first startup.

    Append ‘,localhost’ to WEBLATE_ALLOWED_HOSTS to be able to access locally for testing.

    You may also need to edit the docker-compose.yml file and change the default port from 80 if you already have a web server running on your local machine.

  4. Start Weblate containers:

    docker-compose up
    

Enjoy your Weblate deployment, it’s accessible on port 80 of the weblate container.

Changed in version 2.15-2: The setup has changed recently, priorly there was separate web server container, since 2.15-2 the web server is embedded in the Weblate container.

Changed in version 3.7.1-6: In July 2019 (starting with the 3.7.1-6 tag), the containers is not running as a root user. This has lead to changed exposed port from 80 to 8080.

  1. Iniciando
  • POLÍTICA DE PRIVACIDADE