NOTE: This is an old article. Please go to the Meshlium development section in order to get the latest tutorials.

Howto join two mesh networks

This article settle the basics to use a mesh network to join several networks. This article objective is to show in a easy way the basics of mesh configuration and the possibilities of Meshlium joining communication interfaces.

mesh-net

Minimum Requirements

  • All Meshlium has at least one 2.4GHz High Power for mesh network.
  • 2 LAN connected to two Meshlium through ethernet
  • 2-n Meshliums



Configuring mesh networks

Mesh subnet is 10.10.10.0/24. The ip for the two Meshlium that will join LAN networks are 10.10.10.1 and 10.10.10.250. Other Meshlium on mesh network will use ip address from 10.10.10.2  to 10.10.10.249. Ip address 10.10.10.251-10.10.10.254 are reserved for future services.

To configure 10.10.10.1 and 10.10.10.250 wifi interfaces use those values:


wifi-conf

Is necessary to join ethernet and wifi interfaces in the Meshlium Manager Software

join-networks

Those are the basic configuration, other parameters will be exposed bellow.



Configuring network 1

LAN subnet is 192.168.1.0/24, ip addresses on the LAN used are 192.168.1.250 wich is the ip of the Meshlium ethernet interface and 192.168.1.1 wich is used by device that provides DNS server and internet access.

Meshlium ethernet interface is configured as shown.

ethernet-config

On mesh configuration in Meshlium Manager System configure olsr to make mesh in the ath0 interface with the default values.

olsr-config



Configuring network 2

LAN subnet is 192.168.2.0/24, ip addresses on the LAN used are 192.168.2.1 wich is the ip of the Meshlium ethernet interface. Internet access will be provided by the same device that provides internet access in network 1. So we will configure our gateway to 192.168.1.1
On mesh configuration in Meshlium Manager System configure olsr to make mesh in the ath0 interface with the default values as in network 1.
A sample configuration for the workstations in the network 2 that will use Meshlium as gateway can be this one:


auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1



Configuring the routes

Once networks are configured just need to configure routes so all the frames uses the right path.

Workstations in Network 2 :

route add default gw 192.168.2.1

Meshlium in Network 2:

route add default gw 10.10.10.250
route addd -net 192.168.2.0/24 dev eth0

Workstations in Network 1:

route add -net 192.168.2.0/24 gw 10.10.10.2

Meshlium in Network 1:

route add default gw 192.168.1.1
  
route add -net 10.10.10.0/24 dev ath0
route add -net 192.168.2.0/24 gw 10.10.10.2
nat.sh ath0 eht0 192.168.2.0/24
nat.sh eth0 ath0 192.168.2.0/24



Configuring persistent routes:

Once networks are configured to ensure that routes will be persistent after a blackout, just edit file /etc/init.d/persistent-routes or if file has not been created before create file and edit with this contents:

Workstations in Network 2 :

#!/bin/bash
  
route add default gw 192.168.2.1

Meshlium in Network 2:

#!/bin/bash
  
route addd -net 192.168.2.0/24 dev eth0
route add default gw 10.10.10.250

Workstations in Network 1:

#!/bin/bash
  
route add -net 192.168.2.0/24 gw 10.10.10.2

Meshlium in Network 1:

#!/bin/bash
  
route add default gw 192.168.1.1
route add -net 10.10.10.0/24 dev ath0
route add -net 192.168.2.0/24 gw 10.10.10.2
nat.sh ath0 eht0 192.168.2.0/24
nat.sh eth0 ath0 192.168.2.0/24

Then execute on each machine

chmod +x /etc/init.d/persistent-routes
  
update-rc.d /etc/init.d/persistent-routes defaults

And routes will be added each time meshlium turns on.


© Libelium Comunicaciones Distribuidas S.L.

| Terms of use