Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread Eric Smith
(Alioth up again, thanks Timo)

Weird issue. I had no problem a few days ago with internet access on 
the the phone. Now I connect fine with the pc but cannot get access to 
the internet on the phone.

Cannot think of anything that has changed, any ideaS?

Connect with;
sudo ip address add 192.168.0.200/24 dev eth2
sudo ip link set dev eth2 up
ssh root@192.168.0.202

ifconfig on pc
eth2  Link encap:Ethernet  HWaddr 00:1f:11:01:0e:68  
  inet addr:192.168.0.200  Bcast:0.0.0.0  Mask:255.255.255.0
  inet6 addr: fe80::21f:11ff:fe01:e68/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:739 errors:1 dropped:0 overruns:0 frame:0
  TX packets:490 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:71970 (70.2 KiB)  TX bytes:51814 (50.5 KiB)

ifconfig on phone and route;
usb0  Link encap:Ethernet  HWaddr 00:1F:11:01:0E:67  
  inet addr:192.168.0.202  Bcast:192.168.0.255  Mask:255.255.255.0
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:546 errors:0 dropped:0 overruns:0 frame:0
  TX packets:866 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:49326 (48.1 KiB)  TX bytes:95962 (93.7 KiB)

root@om-gta02 ~ # route 
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
192.168.0.0 *   255.255.255.0   U 0  00 usb0
default 192.168.0.200   0.0.0.0 UG8  00 usb0

-- 
- Eric Smith
Eric Smith said:
 I also cannot find a kernel image either through the install
 or by googling.
 E: Unable to locate package linux-image-2.6.29-openmoko-gta02
 
 Any ideas short of compiling?
 
 -- 
 - Eric Smith
 Eric Smith said:
  Has anyone recently successfully installed debian on the gta02?
  
  I am getting errors that I think are all related to retrieve
  errors.
  
  And are there any other FSO mirrors as this one is not
  accessible, http://pkg-fso.alioth.debian.org/debian
  
  -- 
  - Eric Smith

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread Timo Juhani Lindfors
Hi,

1) How about

iptables -nvL
iptables -nvL -t nat

on the PC?

2) And /etc/resolv.conf on the phone?

3) Try ping -n 192.168.4.200 on the phone?


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread Eric Smith
Thanks Timo.

Timo Juhani Lindfors said:
 1) How about
 
 iptables -nvL
 iptables -nvL -t nat
 
 on the PC?

eric@debian:~$ sudo iptables -nvL
WARNING: All config files need .conf: /etc/modprobe.d/libpisock9, it 
will be ignored in a future release.
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


eric@debian:~$ sudo iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target prot opt in out source   destination 


 
 2) And /etc/resolv.conf on the phone?

root@om-gta02 ~ # cat /etc/resolv.conf
nameserver 208.67.222.222
nameserver 208.67.220.220


 3) Try ping -n 192.168.4.200 on the phone?


root@om-gta02 ~ # ping -n 192.168.4.200
ping: invalid option -- 'n'
BusyBox v1.18.4 (2011-05-19 22:07:46 CEST) multi-call binary.

Usage: ping [OPTIONS] HOST

Send ICMP ECHO_REQUEST packets to network hosts

Options:
-4,-6   Force IP or IPv6 name resolution
-c CNT  Send only CNT pings
-s SIZE Send SIZE data bytes in packets (default:56)
-I IFACE/IP Use interface or IP address as source
-W SEC  Seconds to wait for the first response 
(default:10)
(after all -c CNT packets are sent)
-w SEC  Seconds until ping exits (default:infinite)
(can exit earlier with -c CNT)
-q  Quiet, only displays output at start
and when finished

root@om-gta02 ~ # ping 192.168.4.200
PING 192.168.4.200 (192.168.4.200): 56 data bytes
tick tock  ^C
--- 192.168.4.200 ping statistics ---
106 packets transmitted, 0 packets received, 100% packet loss

oot@om-gta02 ~ # ping 192.168.0.200
PING 192.168.0.200 (192.168.0.200): 56 data bytes
64 bytes from 192.168.0.200: seq=0 ttl=64 time=0.000 ms
64 bytes from 192.168.0.200: seq=1 ttl=64 time=0.000 ms
^C


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread Timo Juhani Lindfors
Eric Smith e...@fruitcom.com writes:
 eric@debian:~$ sudo iptables -nvL -t nat
 Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
  pkts bytes target prot opt in out source   
 destination 

 Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
  pkts bytes target prot opt in out source   
 destination 

 Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
  pkts bytes target prot opt in out source
  destination 

This shows that there is no NAT. Your phone can't talk to the outside
world using its private 192.168.4.202 address. You need to setup NAT
that translates packets between public and private address. Something
like

iptables -A POSTROUTING -o net -t nat -j MASQUERADE -s 192.168.4.0/24
echo 1  /proc/sys/net/ipv4/ip_forward

should work assuming that your upstream interface is called net like
here. Yours might be eth0?

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread Eric Smith
Thanks Timo

eric@htpc7:~$ sudo iptables -A POSTROUTING -o net -t nat -j MASQUERADE 
-s 192.168.4.0/24
eric@htpc7:~$ sudo -i
htpc7:~# echo 1  /proc/sys/net/ipv4/ip_forward
htpc7:~# 
htpc7:~#  sudo iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 3 packets, 748 bytes)
 pkts bytes target prot opt in out source   destination 


Chain POSTROUTING (policy ACCEPT 3 packets, 176 bytes)
 pkts bytes target prot opt in out source   destination 

0 0 MASQUERADE  all  --  *  net 192.168.4.0/24   0.0.0.0/0  
 

Chain OUTPUT (policy ACCEPT 3 packets, 176 bytes)
 pkts bytes target prot opt in out source   destination 


htpc7:~# ping 192.168.4.202
PING 192.168.4.202 (192.168.4.202) 56(84) bytes of data.
^C
--- 192.168.4.202 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4015ms


-- 
- Eric Smith
Timo Juhani Lindfors said:
 Eric Smith e...@fruitcom.com writes:
  eric@debian:~$ sudo iptables -nvL -t nat
  Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
   pkts bytes target prot opt in out source   
  destination 
 
  Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
   pkts bytes target prot opt in out source   
  destination 
 
  Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
   pkts bytes target prot opt in out source
   destination 
 
 This shows that there is no NAT. Your phone can't talk to the outside
 world using its private 192.168.4.202 address. You need to setup NAT
 that translates packets between public and private address. Something
 like
 
 iptables -A POSTROUTING -o net -t nat -j MASQUERADE -s 192.168.4.0/24
 echo 1  /proc/sys/net/ipv4/ip_forward
 
 should work assuming that your upstream interface is called net like
 here. Yours might be eth0?
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Installing debian - kernel - internet access on phone

2011-05-24 Thread shamsul hassan
Hi Eric,

Use the below method and script to ssh into the Neo and share the internet
connection with your laptop.I always use it from any Linux machine and it
works like charm --

On your Laptop --

1) Type ifconfig -a  before connecting the Neo through usb
2) Now connect Neo through usb and again type ifconfig -a , whichever the
new interface visible which was not there is Step 1 is the interface for Neo
, usually it is either usb0 or eth0.
3) save the below script as startmyneo :) -- Any name u want .. ..chmod
755 that script and then run the below script just passing the interface
name found above in step 2 as the parameter 1 and the internet interface on
your laptop as parameter 1 ) mine is wlan0 on my laptop--

root@bt# ./startmyneo usb0 wlan0

Please note -- while running this script might ask for the root password on
Neo as we are ssh ing into it.
Here is the startmyneo script , which you can save on your deskop and has
to be run from your desktop --

#!/bin/bash
interface=$1
desktop_inet_interface=$2
ip address add 192.168.0.200/24 dev $interface
ifconfig $interface 192.168.0.200 netmask 255.255.255.0 up
route add -host 192.168.0.202 dev $interface
ssh root@192.168.0.202
#this section is for the internet on NEO from ur Desktop in between net n
Neo
echo nameserver 192.168.0.1  /etc/resolv.conf
echo 1  /proc/sys/net/ipv4/ip_forward
echo 1  /proc/sys/net/ipv4/ip_dynaddr
modprobe ip_tables
modprobe iptable_nat
modprobe ipt_MASQUERADE
iptables -t filter -F
iptables -t nat-F
iptables -t filter -P INPUT   ACCEPT
iptables -t filter -P FORWARD ACCEPT
iptables -t filter -P OUTPUT  ACCEPT
iptables -t nat-P PREROUTING  ACCEPT
iptables -t nat-P POSTROUTING ACCEPT
iptables -t nat -A POSTROUTING -o $desktop_inet_interface -s
192.168.0.0/24-j MASQUERADE


Thanks
Shamsul

Courage is contagious

On Tue, May 24, 2011 at 9:03 PM, Eric Smith e...@fruitcom.com wrote:

 Thanks Timo

 eric@htpc7:~$ sudo iptables -A POSTROUTING -o net -t nat -j MASQUERADE
 -s 192.168.4.0/24
 eric@htpc7:~$ sudo -i
 htpc7:~# echo 1  /proc/sys/net/ipv4/ip_forward
 htpc7:~#
 htpc7:~#  sudo iptables -nvL -t nat
 Chain PREROUTING (policy ACCEPT 3 packets, 748 bytes)
  pkts bytes target prot opt in out source
 destination

 Chain POSTROUTING (policy ACCEPT 3 packets, 176 bytes)
  pkts bytes target prot opt in out source
 destination
 0 0 MASQUERADE  all  --  *  net 192.168.4.0/24
 0.0.0.0/0

 Chain OUTPUT (policy ACCEPT 3 packets, 176 bytes)
  pkts bytes target prot opt in out source
 destination

 htpc7:~# ping 192.168.4.202
 PING 192.168.4.202 (192.168.4.202) 56(84) bytes of data.
 ^C
 --- 192.168.4.202 ping statistics ---
 5 packets transmitted, 0 received, 100% packet loss, time 4015ms


 --
 - Eric Smith
 Timo Juhani Lindfors said:
  Eric Smith e...@fruitcom.com writes:
   eric@debian:~$ sudo iptables -nvL -t nat
   Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source
 destination
  
   Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source
 destination
  
   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source
destination
 
  This shows that there is no NAT. Your phone can't talk to the outside
  world using its private 192.168.4.202 address. You need to setup NAT
  that translates packets between public and private address. Something
  like
 
  iptables -A POSTROUTING -o net -t nat -j MASQUERADE -s 192.168.4.0/24
  echo 1  /proc/sys/net/ipv4/ip_forward
 
  should work assuming that your upstream interface is called net like
  here. Yours might be eth0?
 
  ___
  Openmoko community mailing list
  community@lists.openmoko.org
  http://lists.openmoko.org/mailman/listinfo/community

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community