Establishing a Mesh Portal: Difference between revisions

From OLPC
Jump to navigation Jump to search
(more updates)
No edit summary
Line 5: Line 5:
* A USB ethernet adapter
* A USB ethernet adapter
* One OLPC laptop (XO)
* One OLPC laptop (XO)
* The xo-mpp-server RPM


==What to do==
==What to do==
* Boot up your XO
* Plug the USB ethernet adapter into the XO

* Switch to a virtual terminal (press Ctrl+Alt+F1), and log in as 'root'


* Stop NetworkManager and dhcdbd scripts
* Turn off NetworkManager, dhcdbd (the DHCP D-Bus daemon), and avahi
<pre>
<pre>
chkconfig --level 2345 NetworkManager stop
chkconfig --level 2345 NetworkManager off
chkconfig --level 2345 dhcdbd stop
chkconfig --level 2345 dhcdbd off
chkconfig --level 2345 avahi-daemon off
</pre>
</pre>


Line 33: Line 37:
</pre>
</pre>


* Plug the USB ethernet adapter into the XO
* Create an ifcfg file for your USB wired interface. For example, if your wired interface is eth0, create /etc/sysconfig/network-scripts/ifcfg-eth0, which should contain:


* Reboot; type 'reboot' and press enter
<pre>
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
</pre>


* Wait for the XO to boot to the login prompt, then log in as 'root'
This file will already exist for 'eth0', but if your USB wired interface is _not_ 'eth0', you need to create this file for whatever interface name your wired USB device is.


* Bring up the USB ethernet interface
* Create an ifcfg file for the mesh interface "msh0". Edit /etc/sysconfig/network-scripts/ifcfg-msh0 to look like the following:


<pre>
<pre>
ifup eth0
# Marvell mesh network module
DEVICE=msh0
MODE=ad-hoc
CHANNEL=1
ESSID="olpc-mesh-1"
IPADDR=172.18.16.1
NETMASK=255.255.240.0
NETWORK=172.18.16.0
BROADCAST=172.18.31.255
ONBOOT=yes
</pre>
</pre>


Line 61: Line 52:


<pre>
<pre>
yum -y install dhcp
yum -y install dhcp xo-mpp-server
</pre>
</pre>


You may have to try this command twice; yum sometimes runs out of memory doing dependency solving, and terminates before actually installing the RPM.
You may have to try this command twice; yum sometimes runs out of memory doing dependency solving, and terminates before actually installing the RPM.


* Turn on various services at startup
* Configure DHCP to serve on the mesh interface. Edit /etc/sysconfig/dhcpd so it looks like this:

<pre>
# Command line options here
DHCPDARGS="msh0"
</pre>

* Set up DHCP to provide leases on the mesh interface. Edit /etc/dhcpd.conf to look like the following. For the "option domain-name-servers", use the domain name servers that your USB Ethernet device returned via DHCP, which should be found in /etc/resolv.conf. Don't leave "option domain-name-servers with the "x.x.x.x" values. If you only have one DNS server, omit the second value from at line.

<pre>
subnet 172.18.16.0 netmask 255.255.240.0 {
option routers 172.18.16.1;
option subnet-mask 255.255.240.0;
option broadcast-address 172.18.31.255;
range 172.18.16.2 172.18.31.254;
option domain-name-servers x.x.x.x, x.x.x.x;
default-lease-time 600;
max-lease-time 1800;
}
</pre>

* Set DHCP to run on startup
<pre>
<pre>
chkconfig --level 2345 network on
chkconfig --level 345 iptables on
chkconfig --level 345 dhcpd on
chkconfig --level 345 dhcpd on
chkconfig --level 345 mpp on
</pre>
</pre>


* reboot
* Reboot; type 'reboot' and press enter


and it should all work
and it should all work

Revision as of 22:15, 14 April 2007

It's not entirely automatic quite yet; we'll get a more automatic solution in place soon.

Requirements

  • A USB ethernet adapter
  • One OLPC laptop (XO)
  • The xo-mpp-server RPM

What to do

  • Boot up your XO
  • Switch to a virtual terminal (press Ctrl+Alt+F1), and log in as 'root'
  • Turn off NetworkManager, dhcdbd (the DHCP D-Bus daemon), and avahi
chkconfig --level 2345 NetworkManager off
chkconfig --level 2345 dhcdbd off
chkconfig --level 2345 avahi-daemon off
  • Set your init level to '3'; stopping Sugar and X from starting again.
nano /etc/inittab

find the line with:

id:5:initdefault:

and change the '5' to a '3' so it looks like this instead:

id:3:initdefault:
  • Plug the USB ethernet adapter into the XO
  • Reboot; type 'reboot' and press enter
  • Wait for the XO to boot to the login prompt, then log in as 'root'
  • Bring up the USB ethernet interface
ifup eth0
  • Install the DHCP daemon
yum -y install dhcp xo-mpp-server

You may have to try this command twice; yum sometimes runs out of memory doing dependency solving, and terminates before actually installing the RPM.

  • Turn on various services at startup
chkconfig --level 2345 network on
chkconfig --level 345 iptables on
chkconfig --level 345 dhcpd on
chkconfig --level 345 mpp on
  • Reboot; type 'reboot' and press enter

and it should all work

Further Reading

More information is available on these topics: