Gentoo Archives: gentoo-embedded

From: elmar bucher <elmbeech@×××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] gentoo installation on openmoko freerunner
Date: Sat, 25 Jun 2011 19:31:43
Message-Id: BANLkTi=Aq02wjkHX=BJSLdGQTGSijwK_qQ@mail.gmail.com
In Reply to: Re: [gentoo-embedded] gentoo installation on openmoko freerunner by YoYo Siska
1 Hi Andrej, Peter, Yoyo, and David,
2
3 I was quite in a hurry the last two weeks, that is why I not have
4 replied. Sorry.
5
6 But this weekend finally i got the desktop:freerunner usb networking
7 running. The crack point was at the desktop linux distro I use
8 (gNewSens) not at shr.
9 I list here my solution:
10
11 1) David / Yoyo: is sshd running?
12 It was not. I had even to install and start it:
13 elm@firebolt:~$ sudo apt-get install openssh-server
14 elm@firebolt:~$ sudo /etc apt-get install ssh
15 elm@firebolt:~$ sudo /etc/init.d/ssh start
16 elm@firebolt:~$ ps aux | grep -i ssh
17 root 4950 0.0 0.0 5320 996 ? Ss 20:28 0:00 /usr/sbin/sshd
18 elm 6679 0.0 0.0 312 108 pts/0 R+ 20:50 0:00 grep -i ssh
19
20
21 2) Yoyo: you often asked me about the subnetwork.
22 The mayor problem was that the subnet between the freerunner (eth1:
23 192.168.0.something) and the desktop (eth0: 192.168.0.57) was
24 overlapping. My solution is to move the eth1 usb connection to the
25 freerunner form 192.168.0.0/24 to 192.168.202.0/24.
26 The majority of the needed information I learn from the following pages:
27 http://wiki.openmoko.org/wiki/USB_Networking
28 http://lists.openmoko.org/pipermail/support/2008-August/#1277
29 http://lists.openmoko.org/pipermail/support/2008-August/001282.html
30 http://lists.openmoko.org/pipermail/support/2008-August/001288.html
31 http://lists.openmoko.org/pipermail/support/2008-August/001300.html
32
33 In practices it looks like this:
34 *** on freerunner ***
35 root@om-gta02 ~ # /etc/init.d/networking stop
36 root@om-gta02 ~ # vi /etc/network/interfaces
37 [...]
38 # Ethernet/RNDIS gadget (g_ether)
39 # ... or on host side, usbnet and random hwaddr
40 # elm 2011-06-25
41 auto usb0
42 iface usb0 inet static
43 address 192.168.202.202
44 netmask 255.255.255.0
45 network 192.168.202.0
46 up route add default gw 192.168.202.200 metric 8
47 up echo nameserver 208.67.222.222 > /etc/resolv.conf
48 up echo nameserver 208.67.220.220 >> /etc/resolv.conf
49 down route del default gw 192.168.202.202 metric 8
50 [...]
51 root@om-gta02 ~ # /etc/init.d/networking start
52
53
54 *** on the desktop ***
55 elm@firebolt:~$ sudo ip address add 192.168.202.200/24 dev eth1
56 elm@firebolt:~$ sudo ip link set dev eth1 up
57 elm@firebolt:~$ sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s
58 192.168.202.0/24
59 elm@firebolt:~$ sudo -i
60 root@firebolt:~# echo 1 > /proc/sys/net/ipv4/ip_forward
61 elm@firebolt:~# exit
62 logout
63 elm@firebolt:~$
64
65
66 3a) smoke test form desktop
67 elm @firebolt:~$ ping -c 3 192.168.202.202
68 PING 192.168.202.202 (192.168.202.202) 56(84) bytes of data.
69 64 bytes from 192.168.202.202: icmp_seq=1 ttl=64 time=2.10 ms
70 64 bytes from 192.168.202.202: icmp_seq=2 ttl=64 time=1.35 ms
71 64 bytes from 192.168.202.202: icmp_seq=3 ttl=64 time=1.37 ms
72
73 --- 192.168.202.202 ping statistics ---
74 3 packets transmitted, 3 received, 0% packet loss, time 2001ms
75 rtt min/avg/max/mdev = 1.350/1.607/2.103/0.353 ms
76
77 elm@firebolt:~$ route -n
78 Kernel IP routing table
79 Destination Gateway Genmask Flags Metric Ref Use Iface
80 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
81 192.168.202.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
82 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
83 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
84
85 elm@firebolt:~$ ip addr
86 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
87 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
88 inet 127.0.0.1/8 scope host lo
89 inet6 ::1/128 scope host
90 valid_lft forever preferred_lft forever
91 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
92 link/ether 00:1d:72:92:d1:83 brd ff:ff:ff:ff:ff:ff
93 inet 192.168.0.57/24 brd 192.168.0.255 scope global eth0
94 inet6 fe80::21d:72ff:fe92:d183/64 scope link
95 valid_lft forever preferred_lft forever
96 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
97 link/ether 00:1f:11:01:a9:a6 brd ff:ff:ff:ff:ff:ff
98 inet 192.168.202.200/24 scope global eth1
99
100
101 3b) smoke test form freerunner
102 elm@firebolt:~$ ssh root@192.168.202.202
103 [...]
104
105 root@om-gta02 ~ # route -n
106 Kernel IP routing table
107 Destination Gateway Genmask Flags Metric Ref Use Iface
108 192.168.202.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
109 0.0.0.0 192.168.202.200 0.0.0.0 UG 8 0 0 usb0
110
111 root@om-gta02 ~ # ip addr
112 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
113 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
114 inet 127.0.0.1/8 scope host lo
115 inet6 ::1/128 scope host
116 valid_lft forever preferred_lft forever
117 2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
118 state UP qlen 1000
119 link/ether 00:1f:11:01:a9:a5 brd ff:ff:ff:ff:ff:ff
120 inet 192.168.202.202/24 brd 192.168.202.255 scope global usb0
121 inet6 fe80::21f:11ff:fe01:a9a5/64 scope link
122 valid_lft forever preferred_lft forever
123
124 root@om-gta02 ~ # cat /etc/resolv.conf
125 nameserver 208.67.222.222
126 nameserver 208.67.220.220
127
128 root@om-gta02 ~ # ping -c 3 192.168.202.200
129 PING 192.168.202.200 (192.168.202.200): 56 data bytes
130 64 bytes from 192.168.202.200: seq=0 ttl=64 time=0.000 ms
131 64 bytes from 192.168.202.200: seq=1 ttl=64 time=0.000 ms
132 64 bytes from 192.168.202.200: seq=2 ttl=64 time=0.000 ms
133 --- 192.168.202.200 ping statistics ---
134 3 packets transmitted, 3 packets received, 0% packet loss
135 round-trip min/avg/max = 0.000/0.000/0.000 ms
136
137 root@om-gta02 ~ # ping -c 3 gentoo.org
138 PING gentoo.org (89.16.167.134): 56 data bytes
139 64 bytes from 89.16.167.134: seq=0 ttl=53 time=70.000 ms
140 64 bytes from 89.16.167.134: seq=1 ttl=53 time=60.000 ms
141 64 bytes from 89.16.167.134: seq=2 ttl=53 time=60.000 ms
142 --- gentoo.org ping statistics ---
143 3 packets transmitted, 3 packets received, 0% packet loss
144 round-trip min/avg/max = 60.000/63.333/70.000 ms
145
146
147 THANKS TO ALL OFF YOU! Thank you for taking care!
148 Have a great midsummer weekend too, Elmar