Code: Select all
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
1) If you do it with iptables (I.e., with masquerading), don't you need to specify somewhere what the new local IP subnet is going to be? I.e., somewhere in the "iptables" command line, it should specify something like 192.168.117.*.mikerr wrote:This would probably do what you want(only lasts until a reboot)Code: Select all
echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
Code: Select all
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="Your Wireless SSID Name"
proto=WPA
key_mgmt=WPA-PSK
psk=pskkey
}
Code: Select all
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
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
sudo iw dev wlan0 set 4addr on
Code: Select all
# sudo apt-get install bridge-utils
# sudo brctl addbr br0
# sudo brctl addif br0 wlan0 eth0
Code: Select all
can't add wlan0 to bridge br0: Operation not supported...
Code: Select all
iw dev wlan0 set 4addr on
Code: Select all
# sudo apt-get install bridge-utils
# sudo brctl addbr br0
# sudo brctl addif br0 wlan0 eth0
Code: Select all
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-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
# sudo brctl addif br0 wlan0 eth0
Code: Select all
can't add wlan0 to bridge br0: Operation not supported...
I tried all of that but didn't work for me.gabeblack wrote:I wanted the pi to connect to my access point, and then provide the bridge so that through the ethernet port I could connect a scanner on the same lan as the access point. I also wanted the pi to have an IP on the access point lan as well since via the usb port it would serve up some printers, thus making my printers and scanners connected wirelessly via the pi to the lan.
I finally was able to do it (I'm using wheezy)
step 1:
Setup the pi so that it is able to connect via wpa_supplicant. Terse version to do that follows, but there is better tutorials online on how to do that.
A
Edit /etc/wpa_supplicant/wpa_supplicant.conf: (you'll need to adjust for your settings):BCode: Select all
ctrl_interface=/var/run/wpa_supplicant network={ ssid="Your Wireless SSID Name" proto=WPA key_mgmt=WPA-PSK psk=pskkey }
Test that you can connect via wpa_supplicant:If it looks like you connected, then you are all set. Ctrl-C and go on to step two.Code: Select all
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
step 2:
edit /etc/network/interfaces to look like this:I think the wpa-bridge option takes care of the mac address spoofing so that you don't have to do any iptables or ebtables trick. I did a lot of googling and couldn't find anything that worked. This took me a long time to figure out so I hope it can be useful to someone.Code: Select all
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
Did you try my modified instructions? http://www.raspberrypi.org/phpBB3/viewt ... 52#p337452SirLagz wrote: I tried all of that but didn't work for me.
Might be useful to specify which WiFi adapter you're using ?
I couldn't even get my br0 interface to get an IP address.