Integrating HSMM-MESH into an existing network

From Ohio Packet
Jump to: navigation, search

Integrating HSMM-MESH into an existing network

Natively, a HSMM-MESH node assumes that there is a wired network of computers connected to the (4) LAN interfaces and possibly a high speed Internet connection on the (1) WAN interface. While this may be true for some systems, it does not apply to all. The task of integrating HSMM-MESH into an existing network can be approached several ways. All of them have two requirements.

1. Provide IP routing to the HSMM-MESH network (10.0.0.0/8) automatically
2. Provide name resolution (DNS) for all HSMM-MESH nodes on the network

This is just an example of a basic home network connected to a high speed connection to either a router or router+wireless access point. Other network types are possible and details will be added as time permits. If you have a specific network layout and need help, feel free to contact us.

The first step is to identify the IP block used in your home network. Most of the time, the 192.168.0,1,2.x class C subnet is used. Depending on the manufacturer of the router, the 3rd digit will vary. Linksys usually defaults to 1, I believe Netgear defaults to 2. Now that this is known, it is time to log into the HSMM-MESH node via it's LAN interface to change it's networking setup. The easiest way to do this is to take the HSMM-MESH enabled router and connect it via Ethernet to one of the (4) LAN ports. If your computer is set to automatically obtain an IP address, it should be assigned something in the 172.27.0.x range. This will allow communication to the web interface. Open up a web browser and point it to http://172.27.0.1:8080, you will be redirected to http://172.27.0.1:8080/cgi-bin/status. If this is the first time connecting to the node, the name will resemble something like NODE-www-xxx-yyy where wxy are random numbers between 0 and 254. You must click on the setup link at the top, you will be then prompted to authenticate. The username is root and the default password is "hsmm". This will land you on the setup page. There are a few things you need to do while here.

1. On the WAN section, change thy interface type from Automatic to disabled. This will give us the option to specify a default gateway in the LAN section.
2. On the LAN section, change the IP address to an address which falls within the existing subnet. In this example we will choose 192.168.1.240. The subnet mask of 255.255.255.0 should be left as is. If you want to have the option of providing Internet access to HSMM-MESH, set the default gateway to 192.168.1.1. Defining the gateway does not automatically give HSMM-MESH Internet access, there is a checkbox in the WAN section which can be turned on and off as needed. It is also important to uncheck the "DHCP" option. Your existing router is handling DHCP services and should be the only DHCP server on the network.
3. If you have not already, type and retype a new password for accessing the setup interface/ssh into the HSMM-MESH node.

Once the above are completed, click on the Save Changes button, you will be shown a message that the router must be reboot to pick-up the changes, click on reboot. At this point, you can safely connect the (4) LAN interface into your existing router switch or network switch. If all goes well, you can reconnect your computer to the existing network and ping the new HSMM-MESH node as 192.168.1.240. If this does not work, double check to make sure you have correct wiring between the HSMM-MESH node and existing router or router+wireless access point. This should be possible with any standard Cat-5/5e cable or crossover cable. In the testing done so far, the Ethernet interfaces on the WRT54G/GL are "smart" in that they will flip the transmit and receive lines to obtain a link regardless of the Ethernet cable type used. You should now be able to point your web browser to http://192.168.1.240:8080/status and see the status page of the HSMM-MESH node. No further configuration should is required for the HSMM-MESH node.

The next step is to create a static route for the HSMM-MESH 10.0.0.0/8 network via the HSMM-MESH node's LAN address (192.168.1.240).
If you only plan on having a single computer access the HSMM-MESH network, it is possible to create a static route on a per machine basis. In Windows, this is:

Start -> run -> cmd [enter]
At the shell window type:
route add –p 10.0.0.0 mask 255.0.0.0 192.168.1.240

The –p switch tells Windows that this is a persistent route, that is, it should be preserved across reboots.

If you wish to make all computers on your network able to reach the HSMM-MESH network, it is easier to simply add a static route on the router itself. This is usually achieved by logging into the web interface of the router itself. In this example, we will assume it is http://192.168.1.1. After you have authenticated, you must locate the section of the interface where you can add static routes. This will vary from router to router, but it usually will live in an "Advanced" area. Once this is located, you must enter the IP address which has been assigned to the HSMM-MESH LAN interface which falls within the same subnet as the rest of your network. In our example, this is 192.168.1.240. The correct values for the static route are:

Network: 10.0.0.0
Subnet mask (sometimes called netmask or just mask): 255.0.0.0
Gateway: 192.168.1.240

Once these routes are in place, it may be necessary to reboot the router to pick-up the changes. Once the router is set with the static route, you can test the routing from your computer. You need to find the Wifi IP address of the HSMM-MESH node. This is found on the main status page of the HSMM-MESH node, http://192.168.1.240:8080/cgi-bin/status in our example here. The Wifi address will begin with a 10, the next 3 digits will be within the 0-254 range and have a trailing /8 indicating the subnet mask is 255.0.0.0. For this example, we will say the Wifi address is 10.25.63.47. From the LAN connected computer, open up a shell window by going to:
Start -> run -> cmd [enter]
Then type:
ping 10.25.63.47
If all goes well, you should see 4 echo replies from 10.25.63.47. IP routing is now in place, you must next setup name resolution.
Name resolution is very important to the usage of HSMM-MESH. Since all of the nodes are going to have a seemingly random IP address, having an easily memorized system name will be much easier to work with. There are a few options for this, depending on your knowledge and router type, some may be easier than others. Similarly to the IP routing step above, it is possible to configure on a per computer basis or network wide. For a single computer, the easiest approach is simply to go into the TCP/IP properties of the network adapter, change it from automatically obtained and set it to be:


Preferred: 192.168.1.240 (Our HSMM-MESH node's LAN interface)
Alternate: 192.168.1.1 (Our example router or router+wireless access point).

While in the TCP/IP settings, click on the Advanced button. This will bring up a 4 tabbed window, we're interested in the DNS tab. On the bottom half of the DNS menu, there is a radio button to select "Append these DNS suffixes (in order)". Now is a good time to check to see what is automatically being handed out by your router by executing an "ipconfig /all". This will typically be something akin to your ISP, for example, mine is "columbus.rr.com". Now that it is known, click on the "Add" button and enter in your DHCP set DNS suffix (columbus.rr.com in this example) and click on "Add". Next we will add the DNS suffix for HSMM-MESH. If you've run a default installation of 0.4.0, this will default to "austin.tx.us.mesh". You will want to enter this in as you did for your ISP and click on "Add". Click on OK to close out of Advanced TCP/IP settings, OK again to close out of TCP/IP Properties and lastly "Close" for the Local Area Connection properties.

You can test the DNS setup by opening up a shell window and typing:
ping YOURMESHNODENAME

This should match the name that was entered in the setup page. For this example, we will say our node name is KB8UVN-100. You should see something like this return:
C:\>ping KB8UVN-100
Pinging KB8UVN-100.austin.tx.us.mesh [10.25.63.47] with 32 bytes of data:
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Ping statistics for 10.25.63.47:

   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), 

Approximate round trip times in milli-seconds:

   Minimum = 0ms, Maximum = 0ms, Average = 0ms 

This verifies that both name resolution (the translation of KB8UVN-100.austin.tx.us.mesh to 10.25.63.47) and IP routing (obtaining echo replies) is now working.

Name resolution network wide is going to vary from network to network. Some routers/routers+wireless access points will only forward DNS queries up to your Internet Service Provider's DNS systems. If this is the case, it will be necessary to go through the manual DNS configuration outlined above. If you do have the option of controlling where DNS queries are sent, the easiest is to simply adjust the DHCP scope to point DNS to:
192.168.1.240
192.168.1.1
This will try to use the DNS server on the HSMM-MESH network first, on failure fall back onto the DNS server on the router or router+wireless access point. If you are running an aftermarket firmware such as OpenWRT, DD-WRT or Tomato, it is possible to update the DNS configuration on each to simply "forward" all HSMM-MESH related queries onto the local HSMM-MESH node. Most of the time, these will be running a version of DNSMASQ, which usually contains a configuration file within /etc called dnsmasq.conf. If you are new to Linux or are uncomfortable about using SSH, you should just reconfigure each system you want to use HSMM-MESH. If you are comfortable or are feeling adventurous, you will need to SSH into your router or router+wireless access point and configure DNSMASQ to forward all ".mesh" domains to the LAN address of our HSMM-MESH node. This will equate to adding:
local /mesh/192.168.1.240
Once updated, you will either need to kill and restart the dnsmasq process or simply reboot the router or router+wireless access point.
After things have rebooted, you should now be able to ping the HSMM-MESH node by name. Take care in appending the correct DNS suffix. If you have not modified the domain on the HSMM-MESH node, it will default to
"austin.tx.us.mesh". As stated earlier, the output should be very similar

C:\>ping KB8UVN-100.austin.tx.us.mesh
Pinging KB8UVN-100.austin.tx.us.mesh [10.25.63.47] with 32 bytes of data:
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Reply from 10.25.63.47: bytes=32 time<1ms TTL=64
Ping statistics for 10.25.63.47:

   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), 

Approximate round trip times in milli-seconds:

   Minimum = 0ms, Maximum = 0ms, Average = 0ms 

At this point, the entire network can seamless travel between the local network, HSMM-MESH and the Internet.