-
Notifications
You must be signed in to change notification settings - Fork 0
Testbed Computer Setup
This computer is the heart of all the testbed. From here you will run your tests, develop your scripts, compile kernels and save the test results. You will need to have regular user account and from there you will work. This lets few people work together on the testbed and each user will have its own testing scripts, kernels etc.
You can just download and burn the image: mini.iso, and then change the boot sequence in the BIOS to boot the cdrom first. At the installation deselect the Desktop Environment (don’t install the Desktop environment).
To get ssh access to the computer you installed, just login and install the ssh server:
aptitude install openssh-server
SSH to your server and install those packages:
aptitude install \ ltsp-utils ltsp-server apache2 gnuplot \ less ketchup build-essential libncurses5-dev \ vim-full cscope exuberant-ctags openntpd screen \ dnsmasq tcpdump nmap subversion \ wireless-tools syslog-ng gawk git
Uncoment the lines in /root/.bashrc to add some aliases for working with colors and warning before deleting something:
export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias rm='rm -i' alias cp='cp -i' alias mv='mv -i'
You need two ethernet cards, and edit /etc/network/interfaces
:
- testbed internal network
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
- Outside access to the testbed
allow-hotplug eth1
iface eth1 inet dhcp
You will need to replace eth1 and eth0 in your setup, depend on the cards. If you have one card 100 and one 1000, put the 1000 inside the testbed, ie. eth0. The outside interface is just for control and can be 100.
Add the line to the file /etc/exports
:
/opt/ltsp *(ro,no_root_squash,async)
Restart nfs service:
/etc/init.d/nfs-kernel-server restart
To verify that /opt/ltsp
is exported, run exportfs
.
Create entries in the /etc/hosts
:
cat << EOF > /tmp/hosts
- Testbed servers
192.168.1.254 testbed2
192.168.1.250 router
192.168.3.250 192.168.4.250 wrouter
192.168.1.251 src
192.168.3.251 wsrc
192.168.1.252 ap
192.168.2.252 192.168.4.252 wap
192.168.1.253 apc
- Testbed clients
EOF
for i in `seq 1 249`; do for y in 1 2 ; do if [[ $y == 1 ]]; then W= ; else W=w ; fi; echo “192.168.$y.$i ${W}client$i” ;done ; echo ; done >> /tmp/hosts
cat /tmp/hosts >> /etc/hosts
Edit /etc/dnsmasq.conf
to be similar to this:
dhcp-authoritative interface=eth0
- enable dhcp on the 192.168.1 network, but only for configured hosts
dhcp-range=192.168.1.0,static
- rootpath option
dhcp-option=net:ltsp,17,/opt/ltsp/i386
dhcp-option=net:bsd,17,/opt/freebsd4/i386
- define common netboot types
dhcp-vendorclass=etherboot,Etherboot
dhcp-vendorclass=pxe,PXEClient
- Set the boot filename for BOOTP.
dhcp-boot=net:pxe,/ltsp/i386/pxelinux.0
dhcp-boot=net:etherboot,/ltsp/i386/nbi.img
dhcp-boot=net:bsd,/freebsd4/i386/pxeboot
- servers configuration
dhcp-host=00:07:e9:19:eb:b2,router,192.168.1.250,infinite,net:bsd
#dhcp-host=00:00:00:00:00:00,wrouter,192.168.2.250,infinite,net:bsd#dhcp-host=00:00:00:00:00:00,src,192.168.1.251,infinite,net:ltsp
#dhcp-host=00:00:00:00:00:00,wsrc,192.168.2.251,infinite,net:ltsp#dhcp-host=00:00:00:00:00:00,ap,192.168.1.252,infinite,net:ltsp
#dhcp-host=00:00:00:00:00:00,wap,192.168.2.252,infinite,net:ltsp
- client configuration
dhcp-host=00:00:24:C8:6E:54,client1,192.168.1.1,infinite,net:ltsp
#dhcp-host=00:00:00:00:00:00,wclient1,192.168.2.1,infinite,net:ltspdhcp-host=00:00:24:C8:03:E8,client2,192.168.1.2,infinite,net:ltsp
#dhcp-host=00:00:00:00:00:00,wclient2,192.168.2.2,infinite,net:ltsp
You can consult this example for improving this configuration file.
Then run this script to populate the rest of the network:
for i in `seq 1 249`; do for y in 1 2 ; do if [[ $y == 1 ]]; then W= ; else W=w ; fi; echo "#dhcp-host=00:00:00:00:00:00,${W}client$i,192.168.$y.$i,infinite,net:ltsp" ;done ; echo ; done >> /etc/dnsmasq.conf
Edit /etc/default/tftpd-hpa
and change RUN_DAEMON="no"
to RUN_DAEMON="yes"
start tftp server: /etc/init.d/tftpd-hpa start
Populate the links in /var/lib/tftpboot/ltsp/i386/pxelinux.cfg
:
cd /var/lib/tftpboot/ltsp/i386/pxelinux.cfg ln -fs ap `gethostip -x 192.168.1.252` ln -fs src `gethostip -x 192.168.1.251` for i in `seq 1 249`; do ln -sf clients `gethostip -x 192.168.1.$i`; done
NOTE: The real files ap,src,clients will be created after you compile a kernel and install it with cpkrn2tftpdir
To understand what I’m doing you can look here http://www.ltsp.org/twiki/bin/view/Ltsp/Syslog
Append this code to the file/etc/syslog-ng/syslog-ng.conf
# If you wish to get logs from remote machine you will need this server
# to listen upon port 514.
#
source remote { udp(); };
#
# Automatic host sorting
# Store all files beneath '/var/log/NAME OF MACHINE/facility
# Create these directories if required, with the given permissions.
#
destination hosts { file("/var/log/testbed2/$HOST/$FACILITY.log" owner(root)
group(root) perm(0600) dir_perm(0700) create_dirs(yes)); };
#
# log by host (as defined above) anything that's coming from the
# remote socket.
#
log { source(remote); destination(hosts); };
Restart syslog-ng
/etc/init.d/syslog-ng restart