+ All Categories
Home > Documents > Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf ·...

Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf ·...

Date post: 20-Jul-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
15
Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading the Remote Unix Lab Environment (RULE) http://caia.swin.edu.au July 21, 2005 Page 2 CAIA Seminar – 20 th July 2005 RULE Background Project Aim Proposed Changes to RULE Description of RULE Prototype Further Work Overview
Transcript
Page 1: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 1

Gareth Edwards

Joanne Ly

Huu Ngoc Duy Nguyen

Upgrading the Remote Unix Lab Environment (RULE)

http://caia.swin.edu.au July 21, 2005 Page 2CAIA Seminar – 20th July 2005

� RULE Background

� Project Aim

� Proposed Changes to RULE

� Description of RULE Prototype

� Further Work

Overview

Page 2: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 2

http://caia.swin.edu.au July 21, 2005 Page 3CAIA Seminar – 20th July 2005

RULE Background� Remote Unix Learning Environment

� Multiple virtual Unix-like hosts

� Uses FreeBSD’s jail functionality

� Used in HET436: Broadband Multimedia Networks lab exercises

� E.g. Setting up proxy servers

http://caia.swin.edu.au July 21, 2005 Page 4CAIA Seminar – 20th July 2005

RULE Background (Continued)

� Disadvantages

� The jail functionality does not allow students to

have full control of networking functionalities

�No access to the kernel

�Simplistic lab exercises in comparison to subject

contents

�More suitable for usage in a first year subject

� Resource management mechanism

�Does not ensure processes from one jail host does

not starve processes from another jail host

Page 3: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 3

http://caia.swin.edu.au July 21, 2005 Page 5CAIA Seminar – 20th July 2005

Project Aims

� Allow each student their own dedicated FreeBSD host(s)/client(s)

� Students able to modify and rebuild kernel

� Provide mechanisms to restore hosts to a

working configuration

� Controlled via a web interface

� Implement remote hardware resetting

http://caia.swin.edu.au July 21, 2005 Page 6CAIA Seminar – 20th July 2005

RULE Prototype Description

� Each lab group is allocated an 802.1q VLAN

� VLAN connected to a server (through a switch) running:

� NFS, TFTP and DHCP for remote, diskless booting

� Apache, PHP and MySQL for web interface

� Hosts connected to a terminal console server

� Reused from old RULE system

Page 4: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 4

http://caia.swin.edu.au July 21, 2005 Page 7CAIA Seminar – 20th July 2005

RULE Prototype Description (continued)

Hosts

Terminal Console

Server running:

•NFS, TFTP and DHCP

•Apache, PHP and

MySQL

Switch

Firewall

ITS Internet

RULE

VLAN 1 VLAN 2 VLAN 3

http://caia.swin.edu.au July 21, 2005 Page 8CAIA Seminar – 20th July 2005

RULE Server

NFS

TFTP

DHCP

WEB

Page 5: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 5

http://caia.swin.edu.au July 21, 2005 Page 9CAIA Seminar – 20th July 2005

Host

RULE server

vlan 101: 192.168.10.9/29vlan 102: 192.168.10.17/29…..

vlan 108: 192.168.10.65/29

RULE

vlan 101

Port Fa0/1 Trunk port – dot1q enabled

Port Fa0/2

Port Fa0/3

Port Fa0/4

…..

vlan 102 vlan 108

Fa0/5

Fa0/6

Fa0/7

Cisco Switch

VLAN

http://caia.swin.edu.au July 21, 2005 Page 10CAIA Seminar – 20th July 2005

VLAN (continued)

� FreeBSD supports multiple pseudo interfaces (VLANs).

� Assign multiple IP addresses, subnet masks and VLAN tags to one Network Interface

� Used a Cisco switch

�802.1q VLAN setup

�Turn off Spanning-Tree Protocol to avoid PXE boot timeout

Page 6: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 6

http://caia.swin.edu.au July 21, 2005 Page 11CAIA Seminar – 20th July 2005

Terminal Console Server

�Remote console access to RULE

hosts

�Reused from old RULE system

� Supports multi-port serial cards

� Free “conserver” software package

http://caia.swin.edu.au July 21, 2005 Page 12CAIA Seminar – 20th July 2005

Conserver Configuration

�Define serial ports to be monitored and

the speed

�Ensure boot loader uses the serial port

�boot.config

�Allow logins over the console port

�/etc/ttys

Page 7: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 7

http://caia.swin.edu.au July 21, 2005 Page 13CAIA Seminar – 20th July 2005

Remote booting of hosts

� Implemented using Pre-boot eXecutionEnvironment® (PXE)

� Used to boot diskless machines through a

network connection

� DHCP assigns static IP address to host machine, identified by its MAC address

� DHCP points to functional pxeboot executable

� TFTP transfer of pxeboot to host’s local

memory

� Host NFS-mounts a nominated file system

http://caia.swin.edu.au July 21, 2005 Page 14CAIA Seminar – 20th July 2005

DHCP Configuration

� Contents of dhcpd.confhost client2 {

#Assign a static IP to the client

hardware ethernet 00:40:63:cb:56:e5;

fixed-address 192.168.10.15;

#Assign a hostname to the client

send host-name "client2";

#TFTP Server

next-server 192.168.10.1;

#Copy of PXEBOOT on TFTP Server Location

filename "client2/boot/pxeboot";

#Root path to find ‘boot’ folder

option root-path "/diskless/client2/";

}

Page 8: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 8

http://caia.swin.edu.au July 21, 2005 Page 15CAIA Seminar – 20th July 2005

Booting Scenarios

� The student:

� Has modified their kernel and would like to boot

straight off the HDD

� Needs to perform recovery operations

�Boot a GENERIC kernel

�Mount a compressed RAM image of a “known

working” file system exported from a NFS server

� Wants to boot a GENERIC kernel

�But have their file system on the HDD automatically

mounted

http://caia.swin.edu.au July 21, 2005 Page 16CAIA Seminar – 20th July 2005

Modifying the PXE Boot Process

� Standard process needs to be modified

� Each time dhcpd.conf is changed, need to

restart DHCP

� Will disrupt other students

� Better solution:

� Control via combination of different loader.conf files and softlinks

Page 9: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 9

http://caia.swin.edu.au July 21, 2005 Page 17CAIA Seminar – 20th July 2005

loader.conf

� Contains boot information

� the kernel to be booted

� the file system to be mounted

� where to get each one from

�NFS server

�Host HDD

� Can edit this file without requiring any processes to restart

http://caia.swin.edu.au July 21, 2005 Page 18CAIA Seminar – 20th July 2005

� dhcpd.conf specifies location of host boot

folder

� Paths remain static for each individual client

� Can use soft links to point from these locations to a file structure on the NFS server

� Links removed and added depending on how the user requires each client to boot

Soft links

client1 -> rulehost/fbsd410_inst

client2 -> rulehost/fbsd54_ram

client8 -> rulehost/fbsd54_inst

client9 -> rulehost/fbsd54_ram

Page 10: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 10

http://caia.swin.edu.au July 21, 2005 Page 19CAIA Seminar – 20th July 2005

PXE Booting: Scenario 1

� Booting straight off the HDD

� Remove link to host’s boot folder

� PXE boot fails

� Unable to find boot folder

� Proceeds to boot of HDD

http://caia.swin.edu.au July 21, 2005 Page 20CAIA Seminar – 20th July 2005

PXE Booting: Scenario 2

� Boot a GENERIC kernel

� Mount a compressed RAM image of a file system

� Host goes through general PXE boot process

� Contents of loader.conf file in boot folder

mfsroot_load="YES"

mfsroot_type="mfs_root"

mfsroot_name="/boot/mfsroot"

vfs.root.mountfrom="ufs:/dev/md0c"

init_path="/sbin/init"

Page 11: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 11

http://caia.swin.edu.au July 21, 2005 Page 21CAIA Seminar – 20th July 2005

PXE Booting: Scenario 3

� Boot a GENERIC kernel

� Mount file system off HDD

� Host goes through general PXE boot process

� Contents of loader.conf file in boot folder

vfs.root.mountfrom="ufs:/dev/ad0s1a"

http://caia.swin.edu.au July 21, 2005 Page 22CAIA Seminar – 20th July 2005

Web Interface

� Implemented using PHP and MySQL

� MySQL database

� Consists of 3 tables

� Table 1: Stores lab groups’ passwords

� Table 2: Stores a list of which VLANs are assigned to a lab group

� Table 3: Stores which hosts are assigned to a VLAN

Page 12: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 12

http://caia.swin.edu.au July 21, 2005 Page 23CAIA Seminar – 20th July 2005

Web Interface

http://caia.swin.edu.au July 21, 2005 Page 24CAIA Seminar – 20th July 2005

Console Interface

Page 13: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 13

http://caia.swin.edu.au July 21, 2005 Page 25CAIA Seminar – 20th July 2005

Hardware Reset

� Enable physical control of remote host

� Parallel port of NFS sever connected to motherboard power header via simple circuit

� Server application causes power pin to be tied to ground for specified amount of time

� Defined by type of reset

http://caia.swin.edu.au July 21, 2005 Page 26CAIA Seminar – 20th July 2005

Firewall

� IP Firewall (IPFW)

� NATD

� DUMMYNET

ITS

RULE

Firewall

Internet

Page 14: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 14

http://caia.swin.edu.au July 21, 2005 Page 27CAIA Seminar – 20th July 2005

Firewall (continued)

� Rebuild the kernel

� Enable IP Firewall (IPFW), NATD, DUMMYNET at start-up

� Define IPFW rules at: /etc/ipfw.rules

http://caia.swin.edu.au July 21, 2005 Page 28CAIA Seminar – 20th July 2005

Dummynet

� Fair share of bandwidth utilisation between RULE hosts

� Limit the inbound and outbound bandwidth of each RULE host to 200Kbit/s

� Can be included in /etc/ipfw.rules file

Page 15: Upgrading the Remote Unix Lab Environment (RULE)caia.swin.edu.au/talks/CAIA-TALK-050720A.pdf · Swinburne University of Technology 1 Gareth Edwards Joanne Ly Huu Ngoc Duy Nguyen Upgrading

Swinburne University of Technology 15

http://caia.swin.edu.au July 21, 2005 Page 29CAIA Seminar – 20th July 2005

Further Development

� Booting different operating systems

� Booting different types of motherboards

� Administration web interface

� To reallocate hosts to VLANs

� To reallocate VLANs to lab groups

� To update group passwords


Recommended