Documentation/Maemo PC Connectivity Tutorial/Network Sharing

(categorize)
(wikify slightly)
 
(One intermediate revision not shown)
Line 1: Line 1:
-
= Network Sharing =
 
-
 
With Maemo PC Connectivity, you can easily set up an Internet connection and share it from a Maemo device to a host PC or from a host PC to a Maemo device. For sharing a connection from a Maemo device to a host PC, you should configure from which interface (WLAN, USB or Bluetooth) the Maemo device accesses the Internet and share it with other interfaces (WLAN, USB and/or Bluetooth).
With Maemo PC Connectivity, you can easily set up an Internet connection and share it from a Maemo device to a host PC or from a host PC to a Maemo device. For sharing a connection from a Maemo device to a host PC, you should configure from which interface (WLAN, USB or Bluetooth) the Maemo device accesses the Internet and share it with other interfaces (WLAN, USB and/or Bluetooth).
-
= Sharing network from Maemo device =
+
== Sharing network from Maemo device ==
To share a network connection from a Maemo device to a host PC you need perform these steps on the Maemo device:
To share a network connection from a Maemo device to a host PC you need perform these steps on the Maemo device:
Line 9: Line 7:
* Run '''Settings - Control Panel - Connectivity - PC Connectivity Manager'''.
* Run '''Settings - Control Panel - Connectivity - PC Connectivity Manager'''.
* Click on the '''Advanced''' button.
* Click on the '''Advanced''' button.
-
* Select the '''Internet''' connection type, figure [[#fig:pc_connectivity_network_sharing_mpc_maemo_nm_internet_sharing|4.1]].
+
* Select the '''Internet''' connection type, figure [[#figure-pc_connectivity_network_sharing_mpc_maemo_nm_internet_sharing|4.1]].
* With the '''Connect Using''' option, you can choose from which interface (WLAN, WLAN adhoc, USB or Bluetooth) the Maemo device accesses the network.
* With the '''Connect Using''' option, you can choose from which interface (WLAN, WLAN adhoc, USB or Bluetooth) the Maemo device accesses the network.
* With the '''Share internet connection with''' option, you can choose the interfaces (WLAN, USB and/or Bluetooth) with which to share the Internet.
* With the '''Share internet connection with''' option, you can choose the interfaces (WLAN, USB and/or Bluetooth) with which to share the Internet.
* Click on the '''Apply''' button.
* Click on the '''Apply''' button.
 +
<div id="figure-pc_connectivity_network_sharing_mpc_maemo_nm_internet_sharing">
 +
[[Image:mpc_maemo_nm_internet_sharing.png|frame|center|alt=Screenshot of Internet sharing dialog in PC connectivity manager|Figure 4.1: PC Connectivity Manager - Internet Sharing]]
 +
</div>
 +
== Sharing network from Linux ==
-
{| summary="PC Connectivity Manager - Internet Sharing"
+
After you have installed the <code>host-pc-connectivity</code> package to your Linux host PC, you can automatically share an Internet network connection from your Linux host PC to a Maemo device.
-
|+ align="BOTTOM" |'''Figure 4.1:''' PC Connectivity Manager - Internet Sharing
+
-
|-
+
-
|
+
-
[[Image:mpc_maemo_nm_internet_sharing.png|Image mpc_maemo_nm_internet_sharing]]
+
-
|}
+
-
 
+
If you want, you can configure sharing from your Linux host PC manually. Suppose you have an Internet connection through an ethernet cable interface, normally <code>eth0</code>. You can share this network connection with any other interface (USB, Bluetooth and/or WLAN) by executing the following commands:
-
 
+
-
= Sharing network from Linux =
+
-
 
+
-
After you have installed the <span><font face="monospace">host-pc-connectivity</font></span> package to your Linux host PC, you can automatically share an Internet network connection from your Linux host PC to a Maemo device.
+
-
 
+
-
If you want, you can configure sharing from your Linux host PC manually. Suppose you have an Internet connection through an ethernet cable interface, normally <span><font face="monospace">eth0</font></span>. You can share this network connection with any other interface (USB, Bluetooth and/or WLAN) by executing the following commands:
+
  $ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  $ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  $ echo 1 &gt; /proc/sys/net/ipv4/ip_forward
  $ echo 1 &gt; /proc/sys/net/ipv4/ip_forward
-
You can replace <span><font face="monospace">eth0</font></span> with any other interface (<span><font face="monospace">usb0</font></span>, <span><font face="monospace">bnep0</font></span> or <span><font face="monospace">wlan0</font></span>) that has a working Internet connection. To disable network sharing, you should execute the following commands:
+
You can replace <code>eth0</code> with any other interface (<code>usb0</code>, <code>bnep0</code> or <code>wlan0</code>) that has a working Internet connection. To disable network sharing, you should execute the following commands:
  $ iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
  $ iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
  $ echo 0 &gt; /proc/sys/net/ipv4/ip_forward
  $ echo 0 &gt; /proc/sys/net/ipv4/ip_forward
-
If you want to permanently share the network from your Linux host PC, you should edit the <span><font face="monospace">/etc/network/interfaces</font></span> file. For example, you can add the following lines to it to share the network every time the USB interface (<span><font face="monospace">usb0</font></span>) is up.
+
If you want to permanently share the network from your Linux host PC, you should edit the <code>/etc/network/interfaces</code> file. For example, you can add the following lines to it to share the network every time the USB interface (<code>usb0</code>) is up.
-
mapping hotplug
+
<pre>
-
script grep
+
mapping hotplug
-
map usb0
+
script grep
 +
map usb0
-
iface usb0 inet dhcp
+
iface usb0 inet dhcp
-
# commands to enable internet sharing
+
# commands to enable internet sharing
-
up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
+
up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-
up echo 1 &gt; /proc/sys/net/ipv4/ip_forward
+
up echo 1 > /proc/sys/net/ipv4/ip_forward
-
# commands to disable internet sharing
+
# commands to disable internet sharing
-
down iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
+
down iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
-
down echo 0 &gt; /proc/sys/net/ipv4/ip_forward
+
down echo 0 > /proc/sys/net/ipv4/ip_forward
 +
</pre>
-
= Sharing network from Windows =
+
== Sharing network from Windows ==
To share the Internet network from your Windows host PC, you should follow these steps:
To share the Internet network from your Windows host PC, you should follow these steps:
Line 61: Line 54:
* Select the '''Properties''' option.
* Select the '''Properties''' option.
* Select the '''Advanced''' tab.
* Select the '''Advanced''' tab.
-
* Under '''Internet Connection Sharing''', select the '''Allow other network users to connect through this computer's Internet connection''' check-box, figure [[#fig:pc_connectivity_mpc_win_internet_sharing|4.2]].
+
* Under '''Internet Connection Sharing''', select the '''Allow other network users to connect through this computer's Internet connection''' check-box, figure [[#figure-pc_connectivity_mpc_win_internet_sharing|4.2]].
* Click on the '''OK''' button.
* Click on the '''OK''' button.
 +
<div id="figure-pc_connectivity_mpc_win_internet_sharing">
 +
[[Image:mpc_win_internet_sharing.png|frame|center|alt=Screenshot of properties dialog|'''Figure 4.2:''' Local Area Connection Properties dialog]]
 +
</div>
-
 
+
== Sharing network from Mac OS X ==
-
{| summary="Local Area Connection Properties dialog"
+
-
|+ align="BOTTOM" |'''Figure 4.2:''' Local Area Connection Properties dialog
+
-
|-
+
-
|
+
-
[[Image:mpc_win_internet_sharing.png|Image mpc_win_internet_sharing]]
+
-
|}
+
-
 
+
-
 
+
-
 
+
-
= Sharing network from Mac OS X =
+
To share the Internet network from your Mac OS X host PC, you should follow these steps:
To share the Internet network from your Mac OS X host PC, you should follow these steps:
-
* Go to '''System Preferences''' and click on the '''Sharing''' icon, figure [[#fig:pc_connectivity_mpc_mac_internet_sharing_preferences|4.3]].
+
* Go to '''System Preferences''' and click on the '''Sharing''' icon, figure [[#figure-pc_connectivity_mpc_mac_internet_sharing_preferences|4.3]].
* Select the '''Internet Sharing''' service.
* Select the '''Internet Sharing''' service.
-
* From '''Share your connection from''', select the interface that has an Internet connection. For example, ''AirPort'', figure [[#fig:pc_connectivity_mpc_mac_internet_sharing_properties|4.4]].
+
* From '''Share your connection from''', select the interface that has an Internet connection. For example, ''AirPort'', figure [[#figure-pc_connectivity_mpc_mac_internet_sharing_properties|4.4]].
* From '''To computers using''', check the interfaces you want to share the Internet with. For example, '''Bluetooth PAN'''.
* From '''To computers using''', check the interfaces you want to share the Internet with. For example, '''Bluetooth PAN'''.
* Enable the '''Internet Sharing''' check-box.
* Enable the '''Internet Sharing''' check-box.
 +
<div id="figure-pc_connectivity_mpc_mac_internet_sharing_preferences">
 +
[[Image:mpc_mac_internet_sharing_preferences.png|frame|center|alt=Screenshot of system preferences dialog|Figure 4.3: System Preferences dialog]]
 +
</div>
 +
<div id="figure-pc_connectivity_mpc_mac_internet_sharing_properties">
-
{| summary="System Preferences dialog"
+
[[Image:mpc_mac_internet_sharing_properties.png|frame|center|alt=Screenshot of network sharing dialog|'''Figure 4.4:''' Network Sharing dialog]]
-
|+ align="BOTTOM" |'''Figure 4.3:''' System Preferences dialog
+
</div>
-
|-
+
-
|
+
-
[[Image:mpc_mac_internet_sharing_preferences.png|Image mpc_mac_internet_sharing_preferences]]
+
-
|}
+
-
 
+
-
 
+
-
 
+
-
 
+
-
 
+
-
{| summary="Network Sharing dialog"
+
-
|+ align="BOTTOM" |'''Figure 4.4:''' Network Sharing dialog
+
-
|-
+
-
|
+
-
[[Image:mpc_mac_internet_sharing_properties.png|Image mpc_mac_internet_sharing_properties]]
+
-
|}
+
[[Category:Documentation]]
[[Category:Documentation]]

Latest revision as of 14:25, 4 November 2010

With Maemo PC Connectivity, you can easily set up an Internet connection and share it from a Maemo device to a host PC or from a host PC to a Maemo device. For sharing a connection from a Maemo device to a host PC, you should configure from which interface (WLAN, USB or Bluetooth) the Maemo device accesses the Internet and share it with other interfaces (WLAN, USB and/or Bluetooth).

Contents

[edit] Sharing network from Maemo device

To share a network connection from a Maemo device to a host PC you need perform these steps on the Maemo device:

  • Run Settings - Control Panel - Connectivity - PC Connectivity Manager.
  • Click on the Advanced button.
  • Select the Internet connection type, figure 4.1.
  • With the Connect Using option, you can choose from which interface (WLAN, WLAN adhoc, USB or Bluetooth) the Maemo device accesses the network.
  • With the Share internet connection with option, you can choose the interfaces (WLAN, USB and/or Bluetooth) with which to share the Internet.
  • Click on the Apply button.
File:Mpc maemo nm internet sharing.png
Figure 4.1: PC Connectivity Manager - Internet Sharing

[edit] Sharing network from Linux

After you have installed the host-pc-connectivity package to your Linux host PC, you can automatically share an Internet network connection from your Linux host PC to a Maemo device.

If you want, you can configure sharing from your Linux host PC manually. Suppose you have an Internet connection through an ethernet cable interface, normally eth0. You can share this network connection with any other interface (USB, Bluetooth and/or WLAN) by executing the following commands:

$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ echo 1 > /proc/sys/net/ipv4/ip_forward

You can replace eth0 with any other interface (usb0, bnep0 or wlan0) that has a working Internet connection. To disable network sharing, you should execute the following commands:

$ iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
$ echo 0 > /proc/sys/net/ipv4/ip_forward

If you want to permanently share the network from your Linux host PC, you should edit the /etc/network/interfaces file. For example, you can add the following lines to it to share the network every time the USB interface (usb0) is up.

mapping hotplug
script grep
map usb0

iface usb0 inet dhcp
# commands to enable internet sharing
up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
up echo 1 > /proc/sys/net/ipv4/ip_forward
# commands to disable internet sharing
down iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
down echo 0 > /proc/sys/net/ipv4/ip_forward

[edit] Sharing network from Windows

To share the Internet network from your Windows host PC, you should follow these steps:

  • Open the Start - Control Panel - Network and Internet Connections - Network Connections dialog.
  • Right click the interface from which you access the Internet.
  • Select the Properties option.
  • Select the Advanced tab.
  • Under Internet Connection Sharing, select the Allow other network users to connect through this computer's Internet connection check-box, figure 4.2.
  • Click on the OK button.
File:Mpc win internet sharing.png
Figure 4.2: Local Area Connection Properties dialog

[edit] Sharing network from Mac OS X

To share the Internet network from your Mac OS X host PC, you should follow these steps:

  • Go to System Preferences and click on the Sharing icon, figure 4.3.
  • Select the Internet Sharing service.
  • From Share your connection from, select the interface that has an Internet connection. For example, AirPort, figure 4.4.
  • From To computers using, check the interfaces you want to share the Internet with. For example, Bluetooth PAN.
  • Enable the Internet Sharing check-box.
File:Mpc mac internet sharing preferences.png
Figure 4.3: System Preferences dialog
File:Mpc mac internet sharing properties.png
Figure 4.4: Network Sharing dialog