[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

¡Esta es una revisión vieja del documento!


En proceso de traducción. Sea paciente. rramp.

Enrutando Wi-Fi a eth (puente)

Este Howto describe, como interconectar una red inalámbrica y una cableada sobre la misma computadora Linux, para permitir que los paquetes TCP/IP no modificados pasen de una interfaz a la otra. En otros lugares esto es mencionado como un puente ethernet o extensor de línea Wi-Fi o como compartir una conexión de internet por Wi-Fi.

This Howto describes, how to interconnect wireless and wired network interfaces on the same Linux computer, to enable unmodified TCP/IP packets to pass from one interface to the other. In other places this is mentioned as network bridge or Wi-Fi line extender or Wi-Fi Internet share.

La razón para este HOWTO: la palabra puente es engañosa

The reason for this HOWTO: the word bridge is misleading

Para un puente de red nosotros asumimos que un dispositivo que transfiere paquetes de red a partir de una conexión de red a otra. For a network bridge we assume a device that transfers unmodified network packets from one network connection to the other. Uno puede crear un dispositivo puente (virtual) y agregar miembros a este. Este funciona solo para miembros de puentes de tipo cableado - eth tarjetas de red. Un puente de red “conecta” miembros sobre capa 3 del modelo OSI. Eso significa comunicación a nivel TCP/IP.

One can create a bridge device (virtual) and add members to it. This works only for bridge members of type wired - eth network cards. A network Bridge “connects” members on level 3 of the OSI model. That means communication on TCP/IP level.\\ Cuando quieres agregar un dispositivo Wi-Fi a un puente, te golpeas con una barrera: los dispositivos Wi-Fi se comunican sobre capa 2 del modelo OSI. When you want to add a Wi-Fi device to the bridge, you hit a barrier: Wi-Fi devices communicate on level 2 of the OSI model. Puedes buscar muchos manuales en internet que documentan como sortear esto (4addr mode). ¡Esto simplemente NO FUNCIONA!

You an find many manuals on the Internet that document how to circumvent this (in the form of putting the Wi-Fi card in 4addr mode).This simply DOES NOT WORK!\\ The Wi-Fi network card (member of the bridge) authenticates and connects to the Wireless Access Point (AP), but TCP/IP packets do not travel over the connection. La tarjeta de red Wi-Fi (miembro del puente) se autentica y se conecta al punto de acceso inalámbrico (AP), pero los paquetes TCP/IP no viajan a través de la conexión.

So searching for “wifi eth bridge” does not return any useful solution. The culprit is the word “bridge”.

Por lo tanto, buscar “wifi eth bridge” no devuelve ninguna solución útil. El culpable es la palabra “puente”.

Solución general

Una solución de trabajo es “Proxy ARP Routing”. Simplemente habilite el reenvío de IP y luego, para cada dispositivo conectado al lado cableado (eth) de un “puente”, debe agregar una línea de enrutamiento a la tabla de enrutamiento. Esto puede se automatizado por un programa como parprouted el demonio proxy ARP de ruteo.

Leyendo de parprouted man page es altamente recomendable estar al tanto de sus limitaciones.

Solución para Slackware, paso a paso

Testeado y trabajando sobre Slackware64-14.2, kernel-4.11.6, CPU i5-7200.

Esta solución es para direcciones IP estáticas. Vea a continuación el enlace de la fuente original para un escenario que usa DHCP.

This solution is for static IP addresses. See below link of original source for a scenario that uses DHCP.

Suposiciones: Queremos interconectar una placa Wi-Fi y una cableada (eth). Los dispositivos de red son wlan0 y eth0. Prepare la su máquina Slackware para que pueda comunicarse a través del adaptador de Wi-Fi (utilizando NetworkManager, rc.inet1 u otros medios..), asegurándose de que el adaptador cableado (eth) no se esté utilizando. Assumptions:\\ We want to interconnect one Wi-Fi and one wired (eth) network card - the network devices wlan0 and eth0.
Prepare Slackware box so that you are able to communicate over the Wi-Fi adapter (using NetworkManager, rc.inet1 or other means…), making sure that the wired (eth) adapter is not being used.
I had set up WPA2 AES verification with NetworkManager to get a usable wpa_supplicant.conf configuration file which I used later with rc.inet1.\\

Yo había configurado la verificación WPA2 AES con NetworkManager para obtener un archivo de configuración utilizable wpa_supplicant.conf que usé más adelante con rc.inet1.

Disable all on-boot network configurations (i.e. make sure that rc.networkmanager or other files for network setup are not executable) and set rc.inet1 executable. Deshabilitar todo en las configuraciones de red de arranque (es decir, asegúrese que rc.networkmanager u otros archivos para la configuración de la red no son ejecutables) y configure rc.inet1 como ejecutable.

  1. IP forwarding debe estar habilitado en el kernel (a partir de la versión 2.1 el núcleo de Linux no requiere una compilación explicita para esto).
  2. IP forwarding must be enabled in the kernel (since the 2.1 release the Linux kernel does not require an explicit compilation option for this)
  3. Editar /etc/rc.d/rc.inet1.conf
  4. edit /etc/rc.d/rc.inet1.conf so to enable wlan0 and eth0. Assign them static IP addresses and set wlan0 to the lowest index and connect to the AP
    Below are example lines from /etc/rc.d/rc.inet1.conf - the only ones without comment sign “#” at the beginning and for WPA2 Wi-Fi authentication
    IFNAME[1]="eth0"
    IPADDR[1]="10.200.200.223"
    NETMASK[1]="255.255.255.0"
    
    GATEWAY="10.200.200.1"
    DEBUG_ETH_UP="no"
    
    IFNAME[0]="wlan0"
    IPADDR[0]="10.200.200.222"
    NETMASK[0]="255.255.255.0"
    USE_DHCP[0]=""
    DHCP_HOSTNAME[0]=""
    
    WLAN_MODE[0]=Managed
    WLAN_ESSID[0]="R7500"
    
    WLAN_WPA[0]="wpa_supplicant"
    WLAN_WPADRIVER[0]="wext"
  5. set /etc/rc.d/rc.ip_forward executable:
    # chmod +x /etc/rc.d/rc.ip_forward
  6. add a line
    /usr/local/sbin/parprouted wlan0 eth0

    to /etc/rc.d/rc.local and make sure that this file is executable

That's all. Reboot and you have a working Wi-Fi - eth bridge, also called Wi-Fi extender or Wi-Fi Internet share.

:!: Note on parprouted compilation:
The parprouted man page section “Requirements” says: “parprouted requires the “ip” program from iproute2 tools to be installed in /sbin. If it is installed in another location, please replace ”/sbin/ip“ occurrences in the source with the correct path”.
Slackware installs the ip program as /sbin/ip so you should be OK.

Variante DHCP habilitada

Busque a continuación una solución en un enlace de origen.

Fuentes

 es:howtos:network_services:wifi_to_eth_bridge_routing ()