I am trying to share my Wifi internet connection on my laptop with a desktop computer temporarily. I have set up a bridge between wlan0 and eth0 (called br0), got an address on br0 from dhcp, and even got an address from the wireless router to the (Windows) pc using dhcp. The pc can ping the laptop, but not ping the router or get on the internet. is there a step i'm missing?
Unfortunately, some wireless cards do not support bridging. In order to forward packets from the wired side of the bridge, the wireless interface needs to 'spoof' the MAC address of the source host. If the card (or driver) is unable to spoof packets, the bridge won't work.
You may want to use NAT instead, or find a different wifi device.
Maybe the routes tables need some adjusting.
Every machine needs to
a) know how to reach other machines in the same network
b) know how to reach everythng else (the internet) through a so called "gateway"
As Paul pointed out, the routing tables should have been set correctly because you are using DHCP but you could check.
I tried something similar with a bridge too, but then I decided to use a 2nd NAT to connect an USB device, so my setting looks like
- router with NAT - desktop-PC with NAT - USB device
and this is simply done with some iptables rules on the PC.
Try clearing your iptables rules.
iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
Also clear your arp table:
arp -d *