Installing debian - kernel - internet access on phone
Eric Smith
es at fruitcom.com
Tue May 24 22:03:28 CEST 2011
Thanks Timo
eric at htpc7:~$ sudo iptables -A POSTROUTING -o net -t nat -j MASQUERADE
-s 192.168.4.0/24
eric at 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 <es at fruitcom.com> writes:
> > eric at 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 at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
More information about the community
mailing list