IOC Robotic's Lab

This script let you bring up two rtnet interfaces and configure them.

#!/bin/sh
echo "Creating the device"
mknod /dev/rtnet c 10 240;

echo "Loading rtnet module"
insmod /usr/local/rtnet/modules/rtnet.ko;

echo "Loading rtipv4 module"
insmod /usr/local/rtnet/modules/rtipv4.ko;

echo "Loading rtpacket module"
insmod /usr/local/rtnet/modules/rtpacket.ko;

echo "Loading rt_loopback module"
insmod /usr/local/rtnet/modules/rt_loopback.ko;

echo "Loading rt_e1000 driver"
insmod /usr/local/rtnet/modules/rt_e1000.ko;

echo "Loading the capture interface module"
insmod /usr/local/rtnet/modules/rtcap.ko;

echo "Configuring the loopback"
/usr/local/rtnet/sbin/rtifconfig rtlo up 127.0.0.1

echo "Configuring the rteth0 interface"
/usr/local/rtnet/sbin/rtifconfig rteth0 up 10.0.0.1 netmask 255.255.255.0;

echo "Waiting 4 seconds ...."
sleep 4;

echo "Configuring the rteth1 interface"
/usr/local/rtnet/sbin/rtifconfig rteth1 up 10.0.1.1 netmask 255.255.255.0;

echo "Waiting 4 seconds ...."
sleep 4;

echo "Attaching explicit to the rteth0 interface"
for((i=1;i<5;i++)); do
/usr/local/rtnet/sbin/rtroute add 10.0.0.$i 00:1b:21:05:0c:fc dev rteth0;