Difference between revisions of "Status/USB Peripheral"

From Maemo Leste Wiki
Jump to navigationJump to search
(add default config file)
 
(5 intermediate revisions by 3 users not shown)
Line 2: Line 2:
Mass Storage may show as an option, but doesn't do anything useful yet.
Mass Storage may show as an option, but doesn't do anything useful yet.


== Bringing up network on your PC ==


== Share PC network with Leste device ==
After plugging USB from your device into your PC, issue:
 
To also have the devices use your PC network, log into the devices:


<pre>
<pre>
ifconfig usb0 up 192.168.42.1
ip link set usb0 up # this one might not really be necessary
ip address add 192.168.42.1/24 dev usb0
ssh root@192.168.42.2
ssh root@192.168.42.2
</pre>
</pre>


The default password is <code>toor</code>.
 
== Share PC network with Leste device ==
 
To also have the devices use your PC network, log into the devices:
 
The default password is <code>toor</code>. (user: <code>root</code>)


And then add the following route on the device:
And then add the following route on the device:
Line 30: Line 35:
iptables -A POSTROUTING -t nat -s 192.168.42.2/32 -j MASQUERADE
iptables -A POSTROUTING -t nat -s 192.168.42.2/32 -j MASQUERADE
</pre>
</pre>
Make sure that forwarding is also allowed within iptables itself, enable it with <code>iptables --policy FORWARD ACCEPT</code>


Now your Leste device should be able to use your PC network
Now your Leste device should be able to use your PC network


== Share Leste network with PC over USB ==
On PC (as root):
<pre>
ifconfig usb0 up 192.168.42.1
ip route add default via 192.168.42.2
</pre>
On Leste (as root):
<pre>
iptables -A FORWARD -i wlan0
iptables -A POSTROUTING -t nat -s 192.168.42.1/32 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/wlan0/forwarding
</pre>
If you want to share the wwan instead, switch out wlan0 for the wwan (e.g. on the Droid that is 'wwan3').


== Notes ==
== Notes ==
* The default IP address is configured in <code>/usr/sbin/pcsuite-enable.sh</code>
* The default IP address is configured in <code>/usr/sbin/pcsuite-enable.sh</code>

Latest revision as of 11:10, 27 March 2021

Currently, devices that are supported by Maemo Leste will automatically set up USB networking if you plug them into a PC. Mass Storage may show as an option, but doesn't do anything useful yet.

Bringing up network on your PC

After plugging USB from your device into your PC, issue:

ip link set usb0 up  # this one might not really be necessary
ip address add 192.168.42.1/24 dev usb0
ssh root@192.168.42.2


Share PC network with Leste device

To also have the devices use your PC network, log into the devices:

The default password is toor. (user: root)

And then add the following route on the device:

ip route add default via 192.168.42.1
# if this fails, first run ip route del default

On your PC, issue:

# (Maybe only one of these two echos is necessary)
echo 1 > /proc/sys/net/ipv4/conf/usb0/forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -A POSTROUTING -t nat -s 192.168.42.2/32 -j MASQUERADE

Make sure that forwarding is also allowed within iptables itself, enable it with iptables --policy FORWARD ACCEPT

Now your Leste device should be able to use your PC network


Share Leste network with PC over USB

On PC (as root):

ifconfig usb0 up 192.168.42.1
ip route add default via 192.168.42.2

On Leste (as root):

iptables -A FORWARD -i wlan0
iptables -A POSTROUTING -t nat -s 192.168.42.1/32 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/wlan0/forwarding

If you want to share the wwan instead, switch out wlan0 for the wwan (e.g. on the Droid that is 'wwan3').

Notes

  • The default IP address is configured in /usr/sbin/pcsuite-enable.sh