Tethering Android phone to Linux to PS3
I am running ubuntu 10.10 and supplying my internet connection with EasyTether on my Motorola Droid 2. I've got my laptop internet working great, but I've tried to follow a couple connection sharing guides and they don't seem to work with my PS3. So the setup is that EasyTether provides the internet connection and an ethernet cable connects the laptop and ps3. I have even tried using FireStarter, but it says eth0 (the connection between laptop and ps3) is not ready.
So here's the question: What should I do to allow my ps3 to access the internet? I've tried manual and automatic settings on my ps3 and neither worked. I believe the problem is with my laptop's settings. Here's what happens when I do a connection test on my PS3 (automatic config) Obatain IP Address - Failed And when I do it manually Obtain IP Address - Succeeded Internet Connection - Failed I'm fairly new to Linux, so please answer in newbie terms. |
I might be able to help you out a little more :)
Ok, I don't have a ps3. So I'm a little handicapped in knowing how/what to do with it to accomplish certain tasks. Quote:
If you don't want to run a DHCP server, we need to set the ps3 to use a static IP or go through the manual config as you mentioned. First, go to your laptop, open a terminal, and execute ifconfig. Your laptop should have at least three network connections (if you're connected through easytether): 1. eth0 2. lo 3. easytether0 Ignore the lo and easytether0 interfaces and focus on the eth0. Find the second line of the information for eth0. It should look something like this: Code:
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0 So you need to configure the ps3 to use an IP address in the same network. With the above output, 192.168.0.202 would work. You may need to give the ps3 a netmask value (e.g. 255.255.255.0) Now you need to tell the ps3 what gateway to use. If the ps3 has an option for that, use your laptop's IP address (e.g. 192.168.0.101). If there is no gateway option, then the ps3 probably assumes the gateway is 192.168.0.1. In that case, you need to reconfigure your laptop to use 192.168.0.1 for it's IP address. Then setup connection sharing on the laptop. The simplest way would be: 1. disable your laptop's firewall entirely (just for testing--craft an appropriate firewall later) 2. execute the following commands: Code:
sudo su - |
Quote:
Also, if this info helps, the following can be modified on ps3 Code:
IP Address (static IP) |
Firestarter is an old firewall program. Not sure if it's still being actively updated, but it's still in the Ubuntu repos and has built-in options for connection sharing and DHCP serving on individual interfaces so you wouldn't have to necessarily assign a static IP to the PS3.
|
Ok, that explains it.
Your laptop is probably configured to use DHCP for eth0. The only way you don't have an IP address for eth0 is if the DHCP request failed. In this case, it would seem clear that you don't have a DHCP server that assigns an IP address to the laptop. Ok, so we'll do a temporary setup. This setup won't survive a reboot, but I'll explain that a little later. So, on your laptop, execute the following commands in a terminal: Code:
sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up Code:
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 IP Address (static IP): 192.168.0.10 Subnet Mask: 255.255.255.0 Default Router: 192.168.0.1 The ps3 address can be anything of the form 192.168.0.??? except for 0, 1, and 255. You shouldn't need to configure the DNS I don't think, but if you do, copy them from the easytether connect output. That should be: Primary DNS: 8.8.8.8 Secondary DNS: 8.8.4.4 Now, jump back to my previous post for the quick-and-dirty connection sharing. Follow those steps, and try connecting with the ps3. Follow-up on the temporary setup. I mentioned that I would come back to it... I suggest the temporary setup because I don't know how you use your laptop. You could have eth0 configured for DHCP for a specific reason, or it could be that way because the Ubuntu install defaults to DHCP. I didn't want to make a change that might otherwise break another use for the laptop (e.g. work). At least this way, you're only a reboot away from getting your default settings back. EDIT: Quote:
That brings up one other issue we may need to address. After you verify that eth0 has an IP address with the ifconfig command, also execute the following and paste the output: Code:
sudo route |
It STILL does the same thing. Also firestarter returns the error "device eth0 is not ready"
I believe we've narrowed the problem down to the actual connection between the laptop and ps3, all the settings seem to be correct other than that. |
Our posts went up about the same time. So I don't know if you were responding to dudeman41465 or me.
I didn't see you post the output of the route command at the end of my last post. So I assumed you hadn't tried out my suggestions. So, just to be thorough, let's step through this. If one of the steps says to verify something, and it does not match what you see, please post the command you issued and the output. Also, I'm not familiar with firestarter, but please disable it for the time being.
Hopefully that will get you connected. If not, do some additional testing for me:
Let me know how it goes. |
Quote:
EDIT: 1. done 2. done 3. done 4. done 5. eth0, lo, and wlan0 6. no inet addr, bcast, or mask 7. done 8. done 9. matches up; done 10. done 11. done 12. output Code:
Destination Gateway Genmask Flags Metric Ref Use Iface 14. done 15. output Code:
Destination Gateway Genmask Flags Metric Ref Use Iface 17. done 18. done - ip address obtained - internet connection failed Side note: The inet addr, bcast, and mask disappear once the ps3 is powered on. I had to run the command again to assign those values, and then I ran ifconfig again to make sure they stayed. 1. done 2. ping failed (no return) 3. done 4. output Code:
Chain INPUT (policy ACCEPT) Here's the output of route after I powered on the ps3 and assigned the values Code:
Destination Gateway Genmask Flags Metric Ref Use Iface I checked in about 5 minutes later with ifconfig and inet addr, bcast, and mask of eth0 were gone. I also used route and eth0 was absent from the list. |
Quote:
Quote:
Quote:
I don't know if you're familiar with the difference, but a store-bought ethernet cable is 90% likely to be a straight-through cable. If you're not sure, you can check yourself. Compare each connector of the cable--have the "clip" face away from you so that you're looking directly at the metal contacts on each connector. Try to identify the coloring of each wire running to each metal contact. If both connectors have the same colored wire running to the same metal contact, then you have a straight-through cable. It's common practice that the wire colorings are arranged this way (but it's not a requirement) from left to right: Code:
white with orange stripe If you have an unused hub or switch, you can avoid getting a crossover cable by plugging the laptop and the ps3 into the hub/switch--the hub/switch handles the necessary wire translation for you internally. If you have a crossover cable and are still having this problem, then I'll need to research to find out if the ps3 is doing something funky when it starts up. |
Quote:
Thanks for the help :D I'm going to order a Crossover Cable later today I was just using a random CAT6 cable I picked up from an unused fax machine Also, would you recommend a CAT5e or CAT6 crossover, or will there be no difference? |
If you've got plans to use the cable at gigabit speeds now or in the future, then get CAT6. Otherwise, save the cash and get CAT5e.
If the only use for the cable is this connection sharing, then you want CAT5e because the phone certainly can't push gigabit speed. In fact, the best speed I've seen peaked at 200 KB/s. And that's well below 10 Mb/s. |
I just got my crossover cable and I get pretty much the same results. In ifconfig the eth0's inet addr, bcast, and mask disappear after a while, and the ping fails.
I even tried turning on my ps3 before doing this entire process and it won't work |
Quote:
At this point, I have to ask: after your initial install of Ubuntu, did you change network settings or install any network software? We'll try something else though. I'm about to give you instructions to configure your wired network interface to use a static IP address. My thinking is that maybe your DHCP client (if you're set up that way) is interfering with the temporary network settings we're using with the ifconfig commands. Take a look at /etc/network/interfaces It should look something like this: Code:
# This file describes the network interfaces available on your system Code:
# This file describes the network interfaces available on your system Note: If something goes wrong, you can go back to your original network configuration by restoring your backup copy. Keep an eye on the settings--see if the interface spontaneously drops them. If the settings stick, try running through the process again. You can skip steps 4-9. |
Quote:
That fixed it, thanks :) |
Great news!
If you feel like tempting fate, you can make the other commands permanent by editing some config files on your laptop. To make it so you don't need to enter echo 1 > /proc/sys/net/ipv4/ip_forward everytime: Edit /etc/sysctl.conf (you'll need root privileges) Find this block of text, delete the hash mark in red, and save the file: Code:
# Uncomment the next line to enable packet forwarding for IPv4 To make it so you don't need to enter iptables -t nat -A POSTROUTING -o easytether0 -j MASQUERADE everytime: Edit /etc/rc.local (you'll need root privileges) Here's a full copy of my rc.local. Yours should be the same, except for the line in green--which you'll add: Code:
#!/bin/sh -e If you setup firewall software, realize that the above change may not work with all firewall configuration tools. Based on the setup we've done, you probably want to focus on protecting the easytether0 interface rather than eth0. Once you make the above changes, you should be good to go. Just flip on the laptop, connect the phone (if you've got udev setup), and setup the ps3. It should be virtually hands-free--depending on whether the ps3 remembers the network settings after cycling the power. |
All times are GMT -5. The time now is 06:12 AM. |