Code: Select all
# ebtables -t nat -A POSTROUTING -o wlan0 -j snat --to-src $MAC_OF_BRIDGE --snat-arp --snat-target ACCEPT
# ebtables -t nat -A PREROUTING -p IPv4 -i wlan0 --ip-dst $IP -j dnat --to-dst $MAC --dnat-target ACCEPT
# ebtables -t nat -A PREROUTING -p ARP -i wlan0 --arp-ip-dst $IP -j dnat --to-dst $MAC --dnat-target ACCEPT
Code: Select all
# EBTABLES_ATOMIC_FILE=/root/ebtables-atomic ebtables -t nat --atomic-save
Code: Select all
# EBTABLES_ATOMIC_FILE=/root/ebtables-atomic ebtables -t nat --atomic-commit
Code: Select all
iw dev wlan0 set 4addr on
Code: Select all
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.801f0282bcc2 no eth0
wlan0
Code: Select all
ifconfig
br0 Link encap:Ethernet HWaddr 80:1f:02:82:bc:c2
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::821f:2ff:fe82:bcc2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:202473 errors:0 dropped:0 overruns:0 frame:0
TX packets:202693 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24581243 (23.4 MiB) TX bytes:29598510 (28.2 MiB)
eth0 Link encap:Ethernet HWaddr b8:27:eb:f5:af:ce
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:197 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15945 (15.5 KiB) TX bytes:2593 (2.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 80:1f:02:82:bc:c2
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:202277 errors:0 dropped:202460 overruns:0 frame:0
TX packets:202887 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:34679086 (33.0 MiB) TX bytes:35297623 (33.6 MiB)
Code: Select all
cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet manual
auto wlan0
iface wlan0 inet manual
auto br0
iface br0 inet dhcp
bridge_ports wlan0 eth0
bridge_stp off
bridge_maxwait 5
wpa-iface wlan0
wpa-bridge br0
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Interesting. I played around with "bridging" on both the Pi and another SBC, with no luck.SirLagz wrote:Ah ha !
Had to install dhcp-relay to get the dhcp packets properly relayed.
Now my pibridge is complete !
You're welcomeJoe Schmoe wrote:I agree. Thanks for the reply.
Or not =/SirLagz wrote:Ah ha !
Had to install dhcp-relay to get the dhcp packets properly relayed.
Now my pibridge is complete !
No, unfortunately not.Joe Schmoe wrote:I see. So, you don't yet have an actual working "Pi as bridge" system, yet.
So, that's why the iptables/NAT solution may still be the only that actually works...
Code: Select all
pi@raspberrypi /etc $ sudo brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000f541594e4 no eth0
ra0
Code: Select all
pi@raspberrypi /etc $ ifconfig
br0 Link encap:Ethernet HWaddr 00:0f:54:15:94:e4
inet addr:192.168.10.245 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::20f:54ff:fe15:94e4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4529 errors:0 dropped:0 overruns:0 frame:0
TX packets:447 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:351512 (343.2 KiB) TX bytes:52307 (51.0 KiB)
eth0 Link encap:Ethernet HWaddr b8:27:eb:19:2b:11
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2232 errors:0 dropped:0 overruns:0 frame:0
TX packets:2021 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:148088 (144.6 KiB) TX bytes:367057 (358.4 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
ra0 Link encap:Ethernet HWaddr 00:0f:54:15:94:e4
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2417742 (2.3 MiB) TX bytes:290076 (283.2 KiB)