Simple Linux IP Repeaters to Extend HomePlug Range
Because μClinux runs on embedded systems, the settings in the previous section must be active immediately after the load. The default installation of a μClinux operating system does not include the packet relaying module. Thus, we first must compile a kernel with packet relaying support, using the following four configuration steps:
Enabling the IP: advanced router option in the Networking options section (Figure 3).
Enabling the /proc filesystem support option in the Filesystems section.
Enabling the Sysctl support option in the General Setup section.
Using the board shown in Figure 5, we must disable the hardware byte-swapping support for CS89x0 Ethernet option in the Ethernet (10 or 100Mbit) section (Figure 4).
Finally, we make three key steps of the repeater setup by modifying the initialization script /etc/rc. First, activate the packet forwarding module shown in line 11 of Listing 1. Second, assign the default IP address, as shown in line 15. Third, start the repeater manager, as shown in line 19.
Listing 1. Modifications to /etc/rc
1 hostname uCsimm 2 /bin/expand /etc/ramfs.img /dev/ram0 3 mount -t proc proc /proc 4 mount -t ext2 /dev/ram0 /var 5 mkdir /var/tmp 6 mkdir /var/log 7 mkdir /var/run 8 mkdir /var/lock 9 mkdir /var/empty 10 11 echo "1" > /proc/sys/net/ipv4/ip_forward 12 13 ifconfig lo 127.0.0.1 14 route add -net 127.0.0.0 netmask 255.0.0.0 lo 15 ifconfig eth0 192.168.0.1 promisc \ netmask 255.255.255.0 broadcast 192.168.0.255 16 17 portmap & 18 cat /etc/motd 19 /bin/hprmanager &
We successfully tested these settings on a Motorola MC68EZ328 DragonBall microcontroller board (Figure 5) with 8MB of RAM, 2MB of Flash ROM, a 10Mbps Ethernet card and the μClinux v2.4.24 operating system.
An extended HomePlug network may have an Internet connection through a modem router. Figure 6 represents this scenario.
Let us consider the Linux desktop repeater to illustrate a solution to provide an Internet connection. If the router in the parent subnet has the address 192.168.0.1, it is necessary to assign a different address to the repeater. Moreover, the routing tables do change. However, the configuration of the computers in subnet B is the same. They simply route Internet-bound packets through the repeater by first issuing:
# route add default gw 192.168.120.1
The computers in subnet A route packets to subnet B through the repeater, and Internet-bound packets go right through the router. In them, we must execute the following commands:
# route add -net 192.168.120.0 netmask 255.255.255.0 gw 192.168.0.2 dev eth0 # route add default gw 192.168.0.1
The repeater must route Internet-bound packets through the router by setting:
# route add default gw 192.168.0.1
Finally, the router sends packets to subnet B through the repeater. The configuration procedure depends on the router model. A typical and easy way is to log in to the Web-based configuration by going to the URL http://192.168.0.1 in any Web browser. Then, it is necessary to add route 192.168.120.0/24 through gateway 192.168.0.2.
Webinar: 8 Signs You’re Beyond Cron
11am CDT, April 29th
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.Join us!
- DevOps: Better Than the Sum of Its Parts
- Return of the Mac
- Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites
- Play for Me, Jarvis
- Non-Linux FOSS: .NET?
- Not So Dynamic Updates
- Designing Foils with XFLR5
- Users, Permissions and Multitenant Sites
- April 2015 Issue of Linux Journal: High-Performance Computing