[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

This is an old revision of the document!


Wifi to eth (bridge) routing

This Howto describes, how to interconnect wireless and wired network interfaces on the same Linux computer, to enable unmodified TCP/IP packets to transpass. On other places this is mentioned as network bridge or WiFi line extender or WiFi Internet share.

The reason for this HOWTO: word bridge is misleading

For a network bridge we assume a device that transfer unmodified network packets from one network connection to the other. One can create a bridge device (virtual) and add members to it. This works only for a members of a type wired - eth network cards. Network Bridge “connects” members on level 3 of OSI model. That means communication on TCP/IP level.
When you want to add a WiFi device to the bridge, you hit to a barrier: WiFi devices communicate on a level 2 of OSI model. So you can find many manuals on the Internet, how to circumvent this (in a form of putting WiFi card to 4addr mode). This simply DO NOT WORK!
WiFi network card (member of bridge) authenticate and connects to AP, but TCP/IP packets do not travel over connection.
So searching for “wifi eth bridge” do not return any useful solution. The culprit is word “bridge”.

General solution

A working solution is “Proxy ARP Routing” You simply enable IP forwarding and then for every device connected to eth side of a “bridge” you have to add a routing line to the routing table. This can be automated by program parprouted - Proxy ARP routing daemon.

Reading of parprouted man page is highly recommended to be aware of limitations

Solution for Slackware, step-by-step

Tested and working on Slackware64-14.2, kernel-4.11.6, CPU i5-7200

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

Assumptions:
We want to interconnect one WiFi and one eth network card - devices wlan0 and eth0.
Prepare Slackware box so, to be able to communicate over WiFi adapter (Networkmanager, rc.inet1 …), eth adapter is idle.
I had set up WPA2 AES verification with Networkmanager to get usable wpa_supplicant.conf later used with rc.inet1.
Disable all bootable network configurations (rc.networkmanager or other files for network setup are not executable) and set rc.inet1 executable.

1. IP forwarding must be enabled at Linux kernel compilation
2. download & compile & install http://www.hazard.maks.net/parprouted/parprouted-0.7.tar.gz :!:
3. edit /etc/rc.d/rc.inet1.conf so to enable wlan0 and eth0, set them static IP numbers and set wlan0 to lowest index and connect to AP
Below lines from /etc/rc.d/rc.inet1.conf are the only without comment sign “#” at the beginning and for WPA2 WiFi 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"

4. set /etc/rc.d/rc.ip_forward executable:

     <code>chmod +x /etc/rc.d/rc.ip_forward</code>

5. add a line:

    <code>/usr/local/sbin/parprouted wlan0 eth0</code> 
      into **/etc/rc.d/rc.local** and make this file executable

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

:!: parprouted compilation:
parprouted man page section “Requirements” says: parprouted requires “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.

DHCP enabled variant

Look below for a solution in a source link.

Sources

 howtos:network_services:wifi_to_eth_bridge_routing ()