On Arch Linux, I would like to have eth0 (connected to bridged router) share the connection received from wlan0, I've read tutorials but I'm not command savvy as other users are and don't completely understand.
|
|
UPDATE It is not possible to bridge between wireless (client a.k.a. station mode) and wired interfaces according to this thread on linux-ath5k-devel. Setup NATOne should set up NAT instead:
Assigning an IPThen you have to assign IP addresses to yourself:
Install dhcp daemonInstall a dhcp server and add the following text to its config file (in /etc/dhcpd.conf or something similar)
Start dhcpdThen start it /etc/init.d/dhcpd start And that's it! Only read below if you are interested in the non-working bridging setup
First you create a bridge interface I choose an arbitrary name mybridge then add intefaces to it. You should request a new ip address (This is needed only if you want to get a valid IP for the bridging device itself):
|
|||||||||||||||||||||
|
|
To bridge wifi interface you may use
ie:
Now it should work. You can show bridges using:
|
|||||||||||||
|
|
Depends on how mean the AP is to you: 1) It might only want to see packets coming from you, with your known link layer address (and hence not of bridged packets) 2) It might actually be even smarter, and know which IP address should belong to which link layer address (cause it knows DHCP and inspects it) If 1+2 are both true, you need indeed something like IP NAT, DHCP, .. But if only 1) is the case, you can fake the link-layer address, and reverse map it onto the right one in the other direction as described here: https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC |
|||||
|
|
To bridge wifi interface you may use
ie:
Now it should work. You can check with:
It might not work if iw itself reports an error, like "command failed: Operation not supported (-95)" (seen on Raspbian). Not all drivers implement the feature, apparently. |
|||||
|
|
4addr as described in other answers is certainly the best way when supported by the adapter/driver, but not all of them does. NAT might work for some things, but getting proper communication both ways on the lan will become problematic (ex. connecting a printer or accessing other IoT devices on the other side of the NAT). Anything relying on broadcast/multicast (ex. auto-discovery, bonjour) will fail through the NAT. The alternative is using an ARP Proxy (parprouted) as described in https://wiki.debian.org/BridgeNetworkConnectionsProxyArp. I've set this up on a Raspberry Pi for a printer and it works like a charm (I have added a 10 second sleep in the |
|||
|
|