In the first part, we became familiar with the hardware we’ll be working on and gathered the needed information. In this part, we focus on making PXE work up to the point we’re able to get to the boot loader and load a kernel.
Now, we connect a Cisco console cable into the designated console port on the modified Cisco IDS. I connected the internet to fxp0 port, and the cluster part to the fxp1 port. Baud rate is 9600, as this is Cisco equipment.
Log into OpenBSD and install the Nano editor by running
login: root Password: Last unsuccessful login: Mon Dec 31 15:51:16 on tty00 OpenBSD 6.4 (GENERIC) #926: Thu Oct 11 13:43:06 MDT 2018 Welcome to OpenBSD: The proactively secure Unix-like operating system. Please use the sendbug(1) utility to report bugs in the system. Before reporting a bug, please try to reproduce it with the latest version of the code. With bug reports, please try to ensure that enough information to reproduce the problem is enclosed, and if a known fix for it exists, include that as well. You have new mail. delta# pkg_add nano quirks-3.16 signed on 2018-10-13T13:42:51Z quirks-3.16: ok nano-3.1:libiconv-1.14p3: ok nano-3.1:gettext-0.19.8.1p1: ok nano-3.1: ok delta#
This will help us with easier editing of configuration files, because the by-default installed vi editor can be confusing to newbies.
First, we configure the /etc/hosts file that will map hostnames of our clients to their IPs. Open the file by running “nano /etc/hosts” and add the following lines to the end of the file:
192.168.10.11 earth 192.168.10.12 wind 192.168.10.13 fire
The file now looks like this:
127.0.0.1 localhost ::1 localhost 192.168.10.11 earth 192.168.10.12 wind 192.168.10.13 fire
Exit nano by pressing Ctrl-x and then y, then Enter.
The next file we will edit is /etc/ethers that contains the MAC adresses and maps them to their hostnames:
00:00:24:C4:55:78 earth 00:00:24:C4:56:18 wind 00:00:24:C4:56:14 fire
Then run these comands, enabling RARP daemon to run on the fxp1 interface
delta# rcctl enable rarpd delta# rcctl set rarpd flags fxp1 delta# rcctl start rarpd
Then create a new directory /var/tftpboot and enter it
delta# mkdir /var/tftpboot delta# cd /var/tftpboot/
Then download the bootloader and kernels by running
delta# ftp https://cdn.openbsd.org/OpenBSD/6.4/i386/pxeboot Trying 151.101.14.217... Requesting https://cdn.openbsd.org/OpenBSD/6.4/i386/pxeboot 100% |**************************************************| 91700 00:00 91700 bytes received in 0.18 seconds (490.03 KB/s) delta# ftp https://cdn.openbsd.org/OpenBSD/6.4/i386/bsd Trying 151.101.14.217... Requesting https://cdn.openbsd.org/OpenBSD/6.4/i386/bsd 100% |**************************************************| 12978 KB 00:03 ^[[A 13289940 bytes received in 3.96 seconds (3.20 MB/s) delta# ftp https://cdn.openbsd.org/OpenBSD/6.4/i386/bsd.rd Trying 151.101.14.217... Requesting https://cdn.openbsd.org/OpenBSD/6.4/i386/bsd.rd 100% |**************************************************| 8571 KB 00:03 8777021 bytes received in 3.42 seconds (2.45 MB/s) delta#
Then we create the instructions for the bootloader to use the console instead of the non-existent video card and boot the ramdisk kernel just to prove the system works.
delta# mkdir etc delta# nano etc/boot.conf
Edit the file to say:
stty com0 19200 set tty com0 boot bsd.rd
Save the file and run:
delta# rcctl enable tftpd delta# rcctl set tftpd flags /var/tftpboot
Now, we will configure the DHCP server. Edit /etc/dhcpd.conf to say:
subnet 192.168.10.0 netmask 255.255.255.0 { group { filename "pxeboot"; next-server 192.168.10.1; host earth { fixed-address 192.168.10.11; hardware ethernet 00:00:24:C4:55:78; } host wind { fixed-address 192.168.10.12; hardware ethernet 00:00:24:C4:56:18; } host fire { fixed-address 192.168.10.13; hardware ethernet 00:00:24:C4:56:14; } }}
And /etc/hostname.fxp1 (the interface facing the clients) to say:
inet 192.168.10.1
Reboot by running ‘reboot’ and when machine reboots, everything should work correctly.
Now we switch the console port to the first Soekris, change the baudrate to 19200 and turn on the power…
POST: 0123456789bcefghipajklnopq,,,tvwxy comBIOS ver. 1.28 20050527 Copyright (C) 2000-2005 Soekris Engineering. net45xx 0064 Mbyte Memory CPU 80486 133 Mhz Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int ------------------------------------------------------------------- 0:00:0 1022 3000 06000000 0006 2280 00 00 00 00000000 00000000 0:18:0 100B 0020 02000000 0107 0290 00 3F 00 0000E001 A0000000 10 1 Seconds to automatic boot. Press Ctrl-P for entering Monitor. NSC DP83815/DP83816 Fast Ethernet UNDI, v1.03 Copyright (C) 2002, 2003 National Semiconductor Corporation All rights reserved. Pre-boot eXecution Environment PXE-2.0 (build 082) Copyright (C) 1997-2000 Intel Corporation CLIENT MAC ADDR: 00 00 24 C4 55 78 CLIENT IP: 192.168.10.11 MASK: 255.255.255.0 DHCP IP: 192.168.10.1 probing: pc0 com0 com1 pci pxe![2.1] mem[639K 63M a20=on] disk: net: mac 00:00:24:c4:55:78, ip 192.168.10.11, server 192.168.10.1 >> OpenBSD/i386 PXEBOOT 3.30 >> OpenBSD/i386 PXEBOOT 3.30 booting tftp:bsd.rd: 3111423+1360896+3362824+0+454656 [363995+98+289392+283301]=0x8ced6c entry point at 0x2000d4 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2018 OpenBSD. All rights reserved. https://www.OpenBSD.org OpenBSD 6.4 (RAMDISK_CD) #916: Thu Oct 11 14:00:12 MDT 2018 deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/RAMDISK_CD real mem = 66646016 (63MB) avail mem = 56418304 (53MB) mainbus0 at root bios0 at mainbus0: date 20/50/27, BIOS32 rev. 0 @ 0xf7840 pcibios0 at bios0: rev 2.0 @ 0xf0000/0x10000 pcibios0: pcibios_get_intr_routing - function not supported pcibios0: PCI IRQ Routing information unavailable. pcibios0: PCI bus #0 is the last bus bios0: ROM list: 0xc8000/0x9000 cpu0 at mainbus0: (uniprocessor) cpu0: AMD Am486DX4 W/B or Am5x86 W/B 150 ("AuthenticAMD" 486-class), 04-09-04 cpu0: FPU pci0 at mainbus0 bus 0: configuration mode 1 (bios) pchb0 at pci0 dev 0 function 0 "AMD ElanSC520 PCI" rev 0x00 sis0 at pci0 dev 18 function 0 "NS DP83815 10/100" rev 0x00, DP83816A: irq 10, address 00:00:24:c4:55:78 nsphyter0 at sis0 phy 0: DP83815 10/100 PHY, rev. 1 isa0 at mainbus0 isadma0 at isa0 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo com0: console com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo pckbc0 at isa0 port 0x60/5 irq 1 irq 12 pckbd0 at pckbc0 (kbd slot) wskbd0 at pckbd0: console keyboard wdc1 at isa0 port 0x170/8 irq 15 wd0 at wdc1 channel 0 drive 0: <064MB ATA Flash Disk> wd0: 1-sector PIO, LBA, 61MB, 125056 sectors wd0(wdc1:0:0): using BIOS timings npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16 softraid0 at root scsibus0 at softraid0: 256 targets PXE boot MAC address 00:00:24:c4:55:78, interface sis0 root on rd0a swap on rd0b dump on rd0b WARNING: clock time much less than file system time WARNING: using file system time WARNING: CHECK AND RESET THE DATE! erase ^?, werase ^W, kill ^U, intr ^C, status ^T Welcome to the OpenBSD/i386 6.4 installation program. Starting non-interactive mode in 5 seconds... (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? sis0: bound to 192.168.10.11 from 192.168.10.1 (00:1a:a2:a4:64:bb)
Yay! As you can see, we have the PXE portion sorted out, enabling us to boot a working install kernel for OpenBSD.
Leave a Reply