Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Airlink Fully compatible Wireless N 150 Ultra Mini-USB Adapter (AWLL5099) with my RaspPi to get internet. I am also bridging this WiFi connection with an Ethernet cable to provide internet to my XBox 360.

However, the WiFi drops out every 30-45 minutes. I am unsure why this is happening. The following is my /etc/network/interfaces setup:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp

auto eth0
iface eth0 inet dhcp

auto br0
iface br0 inet dhcp
bridge_ports wlan0 eth0

EDIT:

Using hatesnakeslovepython's answer works! My connection no longer drops. I was using bridge_utils previously which is what introduced my problem. Exactly what the problem is I am not sure, but using the iptables setup fixed it.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I've also been trying to use my Pi as a wireless adapter for my Xbox 360. Initially, I had an issue where plugging in the ethernet cable (to the powered on Xbox) dropped the wifi connection, and the only way to get it to work again was to unplug and replug the USB wifi dongle (uses the smsc95xx driver, but I had the same issue with other dongles I tested).

For reference, I'm using a similar configuration as posted at linuxquestions.org.

Specifically, I used the following commands:

sudo sysctl -w net.ipv4.ip_forward=1
sudo ifconfig eth0 192.168.1.1
sudo iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.1.0/24 -j MASQUERADE

Then, I configured the Xbox's network settings as

IP address:  192.168.1.2
Subnet mask: 255.255.255.0
Gateway:     192.168.1.1

and I set the primary DNS server to my router's IP address.

This worked but, as I said, you had to replug the USB wifi adapter.

What seems to have fixed (just tried this today) it is advice taken from the Raspberry Pi forum which cites the ifplugd daemon as the cause.

Running the commands:

sudo ifplugd eth0 --kill
sudo ifplugd eth0 --check-running

before setting up iptables seem to have fixed the problem for me.

EDIT: To be clear, I now have the ifplugd kill command (ifplugd check-running just confirms that the daemon has been stopped) followed by the other three commands (sysctl, ifconfig, iptables) in my Pi's /etc/rc.local and the ethernet connection works correctly on startup.

This might not be your issue, especially if it works for a few minutes before dropping. If not, the Pi is a little temperamental with USB hardware; you could always try another dongle (e.g. adapters with various Ralink chipsets seem quite popular for the Pi, and are cheap on eBay) or try a powered USB hub if you're not already using one.

EDIT 2: If you actually do find you need to use the Ethernet connection for some reason (I was diagnosing problems with wifi), an easy way of doing this is something like sudo route add default gw 192.168.0.1 (replacing 192.168.0.1 with your router's IP).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.